youngmon/atlassian-qna huggingface dataset:
Jira Product Discovery automation to keep stakeholders informed
Asked by Claudia Pillay:

I am trying to find a way to keep stakeholders informed about a JPD issue's progress, even if they weren't necessarily the creator of an Idea.

I've tested using the Watcher field and custom people picker fields, but I can't work out how to setup an email or comment automation that tags the correct people.

The email automation fails, and the comment automation lists out the emails or user names that are in Watchers however, it does not successfully tag them.

Has anyone found a workaround to this?


Answers:
author: Bill Sheboy
body: Hi [@Claudia Pillay](/t5/user/viewprofilepage/user-id/5522861) -- Welcome to the Atlassian Community!

For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected. Those will provide context for the community to offer ideas. Thanks!

Until we see those...

To mention a user in a comment, the accountId is used. If you are getting those from a field like Watchers, multiple-selection fields contain a list of values. To mention all the watchers in a comment, [iterate over the values](https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/#Combined-function-examples):

```
watcher mentions: {{#issue.watchers.accountId}}[~accountId:{{.}}]{{^last}}, {{/}}{{/}}
```

If you are trying to email, and using a custom People field, that is not possible. At this time, People type fields in team-managed projects (TMP), including JPD, [cannot access the email address](https://jira.atlassian.com/browse/AUTO-519). The only workaround I know of for JPD projects is to call the REST API with the accountId values to get the email address.

If your stakeholders are not Jira users, you could instead add a custom text field to store the email address, and then use that in the Send Email action.

Kind regards,  
Bill


Tags: cloud

jiraproductdiscovery

jpd

productdiscovery
Send Form as PDF to email
Asked by Jose Ramon Sena Reynoso:

Hi.

I have an Issue with a Form on it and i want to know if I can send a copy of the form or the info in the form can be send to an email, maybe as a PDF or something like it.

Thanks


Answers:
author: Summer Hogan
body: Hi [@Jose Ramon Sena Reynoso](/t5/user/viewprofilepage/user-id/5522759) - Welcome to the community!

I'm not sure which application you are asking about, but I suspect it is Jira or JSM. If so, hopefully one of these articles will help you - <https://confluence.atlassian.com/jirakb/export-forms-spreadsheets-in-jira-cloud-1369442328.html> or <https://support.atlassian.com/jira-service-management-cloud/docs/use-forms-in-jira-service-management/>. If not, please let me know.

comments: author: Jose Ramon Sena Reynoso
body: Thanks a lot. Sorry I didn't specify, but as you assume, its JSM. As you send on the first link, a way to send that PDF by email as soon the request is created.


author: Summer Hogan
body: Hi [@Jose Ramon Sena Reynoso](/t5/user/viewprofilepage/user-id/5522759) if this helped you can you please accept my answer as that helps me? Thank you!
Automation branching variable scope
Asked by Fede B.:

Hi all,

I'm using advanced branching in Cloud Automation, to setup a variable which I use later on, outside of the branch.

But apparently the variable exists only within the scope of the branch, and is null when the code exits the branch.

Example:

- In my Automation, I create an advanced branching by splitting the issue summary with separator ","

- If I find the text "example" inside the branch, I create variable "found", with value "true"

- Outside of the branch, I put a conditional statement: if {{found}} = true

- apparently, this statement is always false, and the variable {{found}} is unset

EDIT: forgot to mention that right now the only workaround I found for this problem, is to add a special label to the issue when I find "example", and re-fetch its data. So, outside of the branch, I just look for that label instead.

Could anyone confirm that this is the expected behaviour?

Thanks


Answers:
author: Bill Sheboy
body: Hi [@Fede B.](/t5/user/viewprofilepage/user-id/5491099)

Yes, that is the expected behavior.

Branches which could be on more than one thing / issue are run in parallel and asynchronously, and so any variable created inside the branch is gone by the end. And...there is no guarantee when such branches will complete, up until the last step of the rule. Thus you could not check such results after the branch (in the rule logic) as the branch is likely still executing.

A workaround for the scenario you describe is to use the text function match(): <https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#match-->

For example, test the result of this:

{{issue.summary.match("(example)")}}

Please see the details of regular expressions to adjust for your needs.

Kind regards,  
Bill

comments: author: Fede B.
body: Hi [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) ,

Thank for your answer.

Yes, in my example the match() function would work, but in reality the automation I'm building is much more complex than that, and using match() results in a lot of work with smart variables and related frustration :-)

It would be nice to have a functionality for branching similar to that of web requests: a checkbox, to make sure that all branch code is processed before continuing to process the rest of the automation. I'm not sure if there's already a ticket to request this feature, I think it's something worth to be voted.

Regards


author: Bill Sheboy
body: There are several open suggestions to add that option for branching, such as this one: <https://jira.atlassian.com/browse/AUTO-32>

Although due to the potential to make longer running rules exceed the service limits, it might then halt all rule executions!

If you want additional help with alternatives for your more complex rule, for which match() may not be a good fit, please describe the problem you are trying to solve and post images of your complete rule and audit log details, and describe what does not work as expected. Those will provide context for the community to offer more suggestions. Thanks!


Tags: branch

smart-value
How to send only ONE email containing all the changes made at the end of an automation process?
Asked by agnes BOURLON:

Here is an automate that add a label on some tickets retrieved from an SQL request.

For each change an email is sent. How to modify this automate to get only one email a the end?

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/330160i13C2BBC2B00930B1/image-size/large?v=v2&px=999 "image.png")

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/330159i2D87D184161101A0/image-size/large?v=v2&px=999 "image.png")


Answers:
author: Bill Sheboy
body: Hi [@agnes BOURLON](/t5/user/viewprofilepage/user-id/5143057)

With the Scheduled Trigger using JQL, the rule is executed for each issue found.

When you only want one email for your scenario, you may remove the JQL from the trigger and use that with the lookup instead:

* trigger: scheduled, with no JQL
* action: lookup issues, use the JQL that was in the trigger
* action: send email

Kind regards,  
Bill

comments: author: agnes BOURLON
body: Hi Bill

Thanks for your answer; I removed the JQL in the trigger and I got this issue. It seems that if I need to use the edit issue later I can't remove the JQL part in the trigger ...

If I remove the For Current issue, I got the same issue

I forgot to say something important, I would like to get if possible only the issues that as been changed by the action Edit Issue (I could have a condition saying that if I already have the label xxxxx I won't add the label otherwise I will add it.

Thx in advance,

Agnes

**![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/330198i13D1E924188E4513/image-size/large?v=v2&px=999 "image.png")**


author: Bill Sheboy
body: That is correct; to edit an issue with a rule, either the trigger or a branch needs to provide it.

If you only want to trigger the rule on that condition, the rule would instead need to trigger on Field Value Changed for Labels, and then add a condition to check the value needed.

Note this will operate on only one issue at a time, and so send an email for each one.

What is the problem you are trying to solve with this rule? Knowing that may help confirm it solves it.
Check for issue updates, but ignore weekend dates
Asked by Christopher Parker:

Hi, I'm trying to resolve an issue with our Jira admins to fix an automation which needs to exclude weekend dates.  

In simple terms, I need an automation which, once an issue is set to "Review", the requestor has 48 hours to respond in any way in the ticket, i.e with a comment or changing the status to "Done". If they don't, the ticket is set to "Amber" and "Blocked" status. This works during weekdays, but we cannot seem to work out how to exclude weekend working days.   

Any suggestions? Many thanks!


Answers:
author: Julian Governale
body: Try the below.

0 30 \* ? \* MON-FRI

I saw an example in their documentation that 1 represents Sunday if 3 represents Tuesday.   

![2024-06-26_17-15-50.png](https://community.atlassian.com/t5/image/serverpage/image-id/331967i86B54386301BB3CE/image-size/large?v=v2&px=999 "2024-06-26_17-15-50.png")

comments: author: Christopher Parker
body: Hi Julian,   

Thanks for the suggestion.  

The issue seems to be more about excluding weekend time from when a ticket hasn't been updated, rather than just when to run the automation rule.  

If I run the rule on a Monday morning and it looks back 48 hours it thinks there have been no updates over the weekend, of course, we have a life! and it applies the automation anyway. My Jira admins say there is no way to deduct weekend time from a ticket when assessing if it has been updated or not.....


author: Ste Wright
body: Hi [@Christopher Parker](/t5/user/viewprofilepage/user-id/5441632)

Welcome to the Community!

Could you provide your current rule, so we can review/refine? That way, we can ensure we work to your specific needs, rather than make assumptions :)

It'd be good to understand the current rule including trigger, conditions, and actions.

Ste

comments: author: Christopher Parker
body: Hi Ste,  

Current settings:-  
![Screenshot 2024-06-17 at 14.11.55.png](https://community.atlassian.com/t5/image/serverpage/image-id/330163i324C78091E16C3A8/image-size/large?v=v2&px=999 "Screenshot 2024-06-17 at 14.11.55.png")  

We had someone update their issue at the weekend so it didn't register their update as I understand the entire weekend period is discounted.   


Tags: cloud

jira
Automation for JSM Assets - JSM
Asked by Jacek:

Good Day

I am a total beginner with JSM and JSM Assets, so excuse me if some questions are for dummies :)

I have actually created our jsm asset schemas for Hardware, Business Partners, Employees. In the Assets everything is linked and referenced fine and everything looks good. The Objects Employees are all linked with their Atlassian ID.

I have created the custom field and am able to search for the laptop of an employee in his created ticket and can add it manually.

But i do not have an clue how to proceed now with an automation. I like to keep it simplest possible. So my idea is to trigger the automation for each issue.reporter and the grab the informations from the assets laptops and link it to the custom field in the jsm ticket.

I appreciate for your ideas and help.

Thank you in advance

J


Answers:
author: Rick Westbrock
body: Editing an Assets field requires that you use a valid AQL query so I think you may need an Assets field for the Employees object type on your issues. From there your edit issue fields action would use an AQL query something like this:

objectType = Laptops AND "Assigned User" = {{issue.Employee}}

comments: author: Jacek
body: Hi Rick

Thank you four your answer. Will try tomorrow when i am back at work.

So it looks that my idea with the aql for the devices in the custom field and the following automation was thought from the false perspective.


author: Jacek
body: Additonally here the attributes for Objects Laptops

![SCR-20240615-levc.png](https://community.atlassian.com/t5/image/serverpage/image-id/330031i21AE499261EC474C/image-size/large?v=v2&px=999 "SCR-20240615-levc.png")

Customn Fiel Config

![SCR-20240615-lfgq.png](https://community.atlassian.com/t5/image/serverpage/image-id/330032i482BE2989F961CA2/image-size/large?v=v2&px=999 "SCR-20240615-lfgq.png")

And automation i tried today

![SCR-20240615-lfoi.png](https://community.atlassian.com/t5/image/serverpage/image-id/330033i51232D6E55EEC911/image-size/large?v=v2&px=999 "SCR-20240615-lfoi.png")

Audit Logs

![SCR-20240615-lfwi.png](https://community.atlassian.com/t5/image/serverpage/image-id/330034iCA1E06F787A5AAF6/image-size/large?v=v2&px=999 "SCR-20240615-lfwi.png")
How to use Jia automation Slack message formatting to show cascading fields
Asked by Jill Vieregge:

I have a cascading cf (Domain/Sub-Domain).

I figured out how to report on slack via Jira automation the Domain

Issue reported for Domain = {{customfield_12330.value}}

Any idea how I can do this for the Sub-domain?


Answers:
author: Bill Sheboy
body: Hi [@Jill Vieregge](/t5/user/viewprofilepage/user-id/4540914)

To access the child of the cascading field, please try this:

```
{{issue.customfield_12330.child.value}}
```

And FYI...to learn about the content and structure of smart values available for an issue, this how-to article can help. The idea is to call the REST API function with a browser tab to query the issue with expanded names, and then review the results.

<https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/>

Kind regards,  
Bill

comments: author: Jill Vieregge
body: Worked great. thanks


Tags: cloud

jira

jira-cloud
Using Automation to update field
Asked by Katherine Lord:

Struggling with the json to update a field.

Trying to copy the value from a Label type field (text) to a asset field. Trying to use automation so we don't have to manually update all the tickets now that we have this information in assets.


Answers:
author: Nicolas Grossi
body: [@Katherine Lord](/t5/user/viewprofilepage/user-id/5281149) You might take a look at this link: <https://community.atlassian.com/t5/Jira-questions/Jira-automation-using-quot-Edit-issue-quot-to-update-a-custom/qaq-p/2182398>

HTH

Nicolas


Tags: cloud

jira

jira-cloud
Automation related issues condition match JQL throws errors when checking for null/empty value
Asked by Syd Heller:

Hi all,

I have an Automation and I am trying to check on related issues that also meet another criteria (that they are not closed) but I am having trouble with the Matching JQL field.

Does anyone have any ideas what JQL I could use here?

![Screenshot 2024-06-14 at 9.07.33?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/329971i695E465C07611FE5/image-size/large?v=v2&px=999 "Screenshot 2024-06-14 at 9.07.33?AM.png")


Answers:
author: Bill Sheboy
body: Hi [@Syd Heller](/t5/user/viewprofilepage/user-id/5330871)

The "matching JQL" for that Related Issues condition must be well-formed JQL. That is...

```
<some_Jira_field> <some_operator> <some_value> ...and so on
```

{{issue.resolution}} cannot be on the left-hand side of the JQL as that would try to compare a value to another value.

Please try this instead:

```
resolution IS EMPTY
```

Kind regards,  
Bill

comments: author: Syd Heller
body: Yup that worked, amazingly simple, thanks!


author: Nicolas Grossi
body: [@Syd Heller](/t5/user/viewprofilepage/user-id/5330871) Could please elaborate ? What errors are you getting ? Also Resolution is empty is different than Issues not closed .

Nicolas

comments: author: Syd Heller
body: Sure, apologies, here is the error I get:

![Screenshot 2024-06-14 at 12.31.41?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/329992i2C6FEBEE321DA8CD/image-size/large?v=v2&px=999 "Screenshot 2024-06-14 at 12.31.41?PM.png")

Sure, they are not the same. For us, Resolution is empty would be sufficient, or Issue is not "Done" or "Declined" would work too if it's easier.

Thanks for the help!


author: Nicolas Grossi
body: [@Syd Heller](/t5/user/viewprofilepage/user-id/5330871) Are you sure that the issue EJ-323 meets the criteria ?

Nicolas


author: Syd Heller
body: I don't know, because it throws that JQL error
Getting the issue linked to the parent with a specific linktype
Asked by Dimitri Cools:

I'm really struggling trying to do something, what I thought was going to be rather easy..

The triggerissue has a parent, this parent has linked issues, with different lintypes, and I (simply) need to retrieve the issue which is linked (to the parent) with a particular link type. (in my case: "External-Internal")

I've been trying multiple angles of logic but all fails..   
Most hopeful I came up with was this, but it doesn't work:

For parent:

{{issue.issuelinks.type.split(",").match("(External-Internal)").outwardIssue.key}}

any help or suggestions would be highly appreciated !


Answers:
author: Bill Sheboy
body: Hi [@Dimitri Cools](/t5/user/viewprofilepage/user-id/3928120)

Short answer:

For this scenario, I recommend using a Lookup Issues action with JQL and the linkedIssues() function for the specify link type to find the issues, then get the keys from the lookup result:

<https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Lookup-issues>  
<https://support.atlassian.com/jira-software-cloud/docs/jql-functions/#linkedIssues-->

More information...

For the expression you show, {{issue.issuelinks.type}} would already be a list, and so the split() is not needed. But even then, the match() shown could not return the entire, linked issue record as it would only be matching on the "type" attribute.

In my experience, the smart value {{issue.issuelinks}} is one that does not load all of the data for the issues in all contexts. Sometimes the data must be loaded into a variable for parsing / filtering. Thus to perform that filtering on the type, the entire list of linked issues would need to be deserialized into a text string, stored in a created variable, filtered with a dynamic regular expression with match(), and then parsed to extract the keys.

Kind regards,  
Bill
Calculating Number of Days within a Service Contract that are within a Fiscal Year
Asked by shelleyc:

Scenario:

Our program has service contracts that don't necessarily follow our fiscal year (July 1 - June 30). The service contracts can be anything ranging from Jan 1 - Dec 31, 9/15 - 9/14 etc. They are all a year in length. We have a service fee (Biotics Fee) that we charge annually. This varies by program. What I need to know is how many days in the service period fall within the Fiscal Year so that I can calculate how much of that fee is captured in this Fiscal Year (and ultimately in either the previous or next FY as well). Once I have the days in Fiscal Year, I can pretty easily figure out the rest. I can either trigger this by an automation to run once a day or have some sort of calculated field (but I couldn't find that available to use)

I have the following fields:

Service From: (DATE) Sept 01, 2024

Service To: (DATE) Aug 31, 2025

Fiscal Year Start Date: July 01, 2024

Fiscal Year End Date: June 30, 2025

Biotics Fee: 18,000

Days in Fiscal Year: ???

Fee in FY: ???

I know from an Excel formula that the days in FY should be 303 and the Fee in FY should be 14942.47. I took the Excel Formula which was:

=MAX(0,MIN($B2,DATE(2025,6,30))-MAX($A2,DATE(2024,7,1))+1)

where B2 is Service To and A2 is Service From and tried to put that into jQL like this:

Min({{issue.Service To}},{{Issue.Fiscal Year End Date}})) - MAX({{Issue.Service From}}, {{Issue.Fiscal Year Start Date}}+1)

Which actually does run, but the result isn't correct (it shows -31).

Any help would be appreciated!


Answers:
author: Bill Sheboy
body: Hi [@shelleyc](/t5/user/viewprofilepage/user-id/5131983)

Comparing what you show, your smart value expression does not match the spreadsheet formula: the first part is missing the outer MAX(0, ...) before performing the subtraction.

I also recommend writing each part to the audit log in your rule and comparing that to the spreadsheet results. That may clarify where there are other differences.

Kind regards,  
Bill


Tags: cloud

jira-work-management

jira-work-management-cloud
Project Lead Smart Values for at mention via Automations
Asked by Casey Enderlein:

**1.) Is there a smart value available to allow at mentioning project lead via comment for a given issue?** For this automation I have setup, I am able to successfully email the project lead using {{triggerIssue.project.lead.displayName}}. I know I can at mention assignee by using \[\~accountid:{{issue.assignee.accountId}}\], therefore I tried using \[\~accountid:{{triggerIssue.project.lead.displayName.accountId}}\] to at mention project lead. The comment posted as expected when rule triggered, but did not at mention project lead in the comments.

**2.) Is there a smart value to hard code users to be at mentioned via comment in automation rule setup?** I have the account IDs for the users I want to be at mentioned in the comment any time rule triggers.

My intended use case is:

1.) To send an at mention comment to the project lead when rule is triggered, as well as,

2.) hard coding the at mentioning for two admins when rule is triggered

Thanks!


Answers:
author: Darryl Lee
body: Hi [@Casey Enderlein](/t5/user/viewprofilepage/user-id/5429919) - I believe what you want for #1 (how to mention the project lead in a comment) is: **\[\~accountid:{{triggerIssue.project.lead.accountId}}\]**

For #2, you should just be able to do:**\[\~accountId:abcd-1234-abcd-1234\]** (where abcd-1234-abcd-1234 is the account ID of the user you want mentioned every time).

comments: author: Casey Enderlein
body: thank you kindly! this answered both my questions - appreciate it!


author: Darryl Lee
body: Hey [@Casey Enderlein](/t5/user/viewprofilepage/user-id/5429919) - glad this worked! Would appreciate if you can Accept this answer.
Team-managed project automation to change Preset Approvers based on custom field
Asked by Bobby Arvanitakis:

Depending on a selected "Division" custom field, with options: Group X, Group Y.  
I want a specific person added as a Preset Approver.

I managed to find the *customfield_10700* id that stores the approvers for that Approval step (different approvers for different statuses).

In my automation, if Division = Group X, I want to populate the Preset approver field with the reporter (as an example):

```
{    "fields": {        "customfield_10700": [            {                "value": "<accountid>"            }        ]    }}
```

Where \<accountid\> is the approver's account id.

In my testing, if an approver is already in this custom field and I run this automation, the current approver is removed, but the new approver isn't added. The automation runs without reported errors.

Would love some help! :)


Answers:
author: Bobby Arvanitakis
body: Figured it out!

```
?{"update":{"customfield_10700":[{"set":[{"accountId":"5f241224cdb7b4001bd41227"}]}]}}
```


author: Bobby Arvanitakis
body: I've tried the following without success:

```
{"update":{"customfield_10700":[{"set":[{"approvers":"62b9844d268cac6e31c355ee"}]}]}}
```

```
{"update":{"customfield_10700":[{"set":[{"value":"62b9844d268cac6e31c355ee"}]}]}}
```

All run without errors, but the approver doesn't change.


Tags: cloud

jira

jira-cloud