youngmon/atlassian-qna huggingface dataset:
What's wrong with my Jira automation smartvalues?
Asked by Jenni J?rvinen:

Hello,  

I'm doing Jira automation scripts for Data Center instance. I have a script that is supposed to send a Slack message when JQL condition of "Resolution in (Duplicate)" in a match. However, I'm not getting the results what I'm hoping for. Details below:  

++Script for Slack message:++   

:two: \<{{issue.url}}\|{{issue.key}}\> has been resolved by {{initiator.displayName}} as \*DUPLICATE\*.

It {{issue.issuelinks.type.inward}} \<[https://my.atlassian.net/browse/{{issue.issuelinks.outwardIssue.key}}\|](https://my.atlassian.net/browse/{{issue.issuelinks.outwardIssue.key}}|){{issue.issuelinks.outwardIssue.key}} {{issue.issuelinks.outwardIssue.fields.summary}}\>.  

++What I'm expecting to see:++   

:two: [PROJECT-123](https://my.atlassian.net/browse/PROJECT-123) has been resolved by Initiator as **DUPLICATE** .  

It is duplicated by [PROJECT-1234](https://my.atlassian.net/browse/PROJECT-1234) This is the duplicate issue.  

++What I'm currently seeing:++   

:two: [PROJECT-123](https://my.atlassian.net/browse/PROJECT-123) has been resolved by Initiator as **DUPLICATE** .  

It .  

++Smart values:++

issue.issuelinks.type.inward = "is duplicated by"  
issue.issuelinks.outwardIssue.key = PROJECT-1234  
issue.issuelinks.outwardIssue.fields.summary = "This is the duplicate issue"  

---

So what am I doing wrong? Are the smart values in wrong format? Should they be #issue or #issuelinks instead?  

Thank you!  

// Jenni


Answers:
author: Mykenna Cepek
body: The documentation for using issueLinks in Smart Values is severely lacking right now -- please provide feedback to Atlassian at the bottom of those documentation pages! Server/DC page [here](https://confluence.atlassian.com/automation/smart-values-993924860.html), Cloud page [here](https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/).

Perhaps issue.issuelinks.outwardIssue might be a list? So perhaps Smart Value list traversal is needed? Server/DC docs [here](https://confluence.atlassian.com/automation/working-with-lists-993924631.html), Cloud docs [here](https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/).

It might be coincidence that {{issue.issuelinks.outwardIssue.key}} appears to resolve as a scalar (not list) value when there is just one item in the list.

comments: author: Bill Sheboy
body: Hi [@Jenni J?rvinen](/t5/user/viewprofilepage/user-id/4740072)

Yes, and...to what Mykenna notes:

I tried your complete expression with a Jira Cloud rule and it works as you expected. The only hiccup was when I had multiple linked issues outward...in which case it concatenated all of the results (i.e. no list iterator needed).

I recommend talking to your site admin to submit a ticket to support for this one to uncover the problem.

Kind regards,  
Bill
updating the remaining estimate of parent issue
Asked by Martin Kovalcik:

Is there a way how to automate updating the remaining estimate of parent issue when work log is created on subtask?


Answers:
author: Mykenna Cepek
body: [This thread](https://community.atlassian.com/t5/Jira-Software-questions/How-to-access-smart-values-for-quot-Remaining-Estimate-quot-and/qaq-p/1362835) explores how you might go about that.

(Tip: using the community search, in this case for "automation remaining", can help uncover answers more quickly.)

But I really suggest you consider this question first: **Do you really want to automate that?**

I see the biggest value of the Remaining Estimate field to be having a human re-evaluate that whenever time is logged. Why? Because usually the Original Estimate is *wrong*.

Having been a developer, and having had to estimate my work, and then log my time, we know this to be true empirically. Any Original Estimates is a guess based on incomplete information.

Consider this... If I thought a Story was going to take me 3 hours, but it only takes me 1 hour, I would log time for 1 hour, set the Remaining Estimate to zero, and transition the issue onward.

Do you really want to bake into your process that instead the issue will get auto-set to "2 hours remaining" after logging that first hour? How many of your remote employees might see that as an opportunity to watch a few more episodes of their favorite show, instead of working on something else? My point is: *that's a bad process*.

If you really don't care about Remaining Estimate, maybe don't use it at all?

comments: author: Curt Holley
body: What [@Mykenna Cepek](/t5/user/viewprofilepage/user-id/3527113) said.
How to retrieve pull request approvers as a jira smart value?
Asked by Joromy.Khalil:

Hi, I have added a trigger which adds a comment onto the associated jira ticket when a pull request is merged. However, I'd like to detail more information (the pull request approvers and author) but am limited by the smart values for pull requests.   

I noticed <https://codebarrel.atlassian.net/browse/AUT-1997> has been raised. Will this change include said values and when should we expect this feature to be implemented.  

Thank you for your help.


Answers:
author: Bill Sheboy
body: Hi [@Joromy.Khalil](/t5/user/viewprofilepage/user-id/4741940) -- Welcome to the Atlassian Community!

IMHO, there's no predicting what that work may include, or when it will be done. You may want to vote for/watch the items linked to that one to see progress:

<https://jira.atlassian.com/browse/JSWCLOUD-21666>  
<https://jira.atlassian.com/browse/JSWCLOUD-20422>

Until then, you could investigate if your tools provide a REST API method that has that information, and then you could use a web request call from the Jira automation rule to get at it.

Kind regards,  
Bill
Automation for Jira in Team Managed project with Issue restriction
Asked by Antonio Cal?:

Premise:  
1) type of project: Team Managed  
2) Restrictions are applied to issues (for example Administrator and member)

Issue:  
the Actor "Automation for Jira" can't perform rules properly (no action performed), results aren't found in Audit Log section using for example JQL conditions in the rule.  
I think the issue is related to Actor's permissions, since without issues restrictions all is working properly.  
How can I solve the problem?


Answers:
author: Curt Holley
body: Hi [@Antonio Cal?](/t5/user/viewprofilepage/user-id/4642353)

Sounds like you pretty much have solved it. You will either have to:  

* remove the permissions from the issues
* change the actor to one with the right permissions
* give the current actor the permissions (though I'm uncertain if this is possible)

comments: author: Curt Holley
body: Note: option 3 can't be done.  

"This user is a system user, and their privileges cannot be modified."


author: Antonio Cal?
body: Hi [@Curt Holley](/t5/user/viewprofilepage/user-id/3527535) I appreciate your time, but the assumption in my Use Case obviously can't be changed!

If I use a normal user with administrator privileges I had already verified that it works, but it is not the same. The idea of an automatic action is lost.  
I thought that somewhere I could give the privileges to Automation for jira, but I learn from your answer that unfortunately there is no way.


author: Curt Holley
body: I don't get how changing the actor to say...you means "The idea of an automatic action is lost".

If you want to keep the actor not related to a person, say....you. Then create a new service account that you can control and add to the relevant groups etc to empower it to run any such restricted issue type automation rules.

Call it "Admin automation for Jira" or "Admin Actor".

Bottomline, it can be done, you just need the right actor.

![istockphoto-861198276-612x612.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/182099i7C82333E9A77D525/image-size/large?v=v2&px=999 "istockphoto-861198276-612x612.jpg")


Tags: restriction

team-managed-projects
How to create a trigger when a particular user assigns a ticket to another particular user?
Asked by al_s:

How to create a trigger when a particular user assigns a ticket to another particular user?

I have a team and sometimes a user is assigning an already overloaded user more tasks. I would like to prevent this by automatically unassigning that dev and making the task only assignable during the next grooming/planning meeting.


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

Two things to consider:

1. You may use the {{initiator}} smart value with a condition to check if a particular person is doing the assignment, and so triggering the rule
2. Using a rule to do this may not solve the root cause of this symptom

Regarding item #2, I recommend having a conversation to learn more about "why" that assignment is happening, and as a team deciding how to experiment and improve.

Automation rules can help reduce redundant work, save time, prevent errors, and close gaps in missing Jira features. They are not a good fit to solve process problems a team could address with collaboration.

Kind regards,  
Bill


author: raju mandapaka
body: Hi [@al_s](/t5/user/viewprofilepage/user-id/4730355)

You can use trigger **issue assigned** and you need to add a condition as shown in below pic.

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

Thanks,

Raju


author: Pramodh M
body: Hi [@al_s](/t5/user/viewprofilepage/user-id/4730355)

You can use the "Issue Assigned" Trigger in Jira Automation!!

Thanks

comments: author: al_s
body: [@Pramodh M](/t5/user/viewprofilepage/user-id/3691224) I need to run the trigger only when one particular user is assigning the work to the other particular user.


author: Pramodh M
body: Follow [@al_s](/t5/user/viewprofilepage/user-id/4730355) rule to check the condition


author: raju mandapaka
body: Hi [@al_s](/t5/user/viewprofilepage/user-id/4730355)

You can use below JQL

assignee = user1 AND assignee changed TO user1 BY user2

Hope this clarifies,

Thanks,

Raju
Jira automation - when the Epic Status is marked as "Done", transition the epic
Asked by arama mihai:

hello,

We would like to set up an automation such as that if the field "Epic Status" of an epic gets set to Done, we perform a certain transition on the epic.

Unfortunately, the condition does not seem to match anything. I tried several options, including:

#### When: The following issue properties are set {#toc-hId--484368688}

{"fields":{"Epic Status":"Done"}}  
Please let me know how to add a condition on the epic status change.  
Thank you


Answers:
author: raju mandapaka
body: Hi [@arama mihai](/t5/user/viewprofilepage/user-id/768249)

Can i know what's the trigger you kept??,

could you please try as below

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

Raju

comments: author: arama mihai
body: Hello [@raju mandapaka](/t5/user/viewprofilepage/user-id/3198822) , [@Jack Brickey](/t5/user/viewprofilepage/user-id/853369)

I tried the following:

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

It says that the issue did not match the jql condition. I have marked the epic as done from the backlog of a scrum board. I believe the "issue matches jql" condition finds the epic status before the change, which is "To Do", and this is why it does not match.

Please let me know if you have any suggestions.

Thank you!


author: raju mandapaka
body: Hi [@arama mihai](/t5/user/viewprofilepage/user-id/768249)

Let's find out the Epic status by smart value, please insert a log action after first condition and keep {{Epic Status}} in that log action, so that we can know what' the status and i advice to keep trigger as filed value changed (Epic status) for only edit issue, so that we can reduce unnecessary logs.

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

Thanks

Raju


author: arama mihai
body: [@raju mandapaka](/t5/user/viewprofilepage/user-id/3198822)

Thank you for your suggestion.

For whatever reason, this automation now works without adding anything else.

We did perform a full reindex today, so perhaps what has helped, considering since the rule hasn't changed since yesterday.

Thank you for your help!


author: Jack Brickey
body: Can you not use the JQL Condition?

![E0E554B2-75D6-429F-8D93-9DD9F5EEEEE4.jpeg](https://community.atlassian.com/t5/image/serverpage/image-id/180265iAC1AB486CF7BF6A2/image-size/large?v=v2&px=999 "E0E554B2-75D6-429F-8D93-9DD9F5EEEEE4.jpeg")


Tags: epic
Simple automation is running too often
Asked by Randy O_Neal:

I have a simple automation; it is running far too frequently and is occasionally erroring, and I'm new enough to this I can't see why.  

The automation is triggered when an issue is transitioned to Done. For the parent, if the issue is a particular custom issuetype "Deployment Activity" and its status is not Done, and its subtasks' status(es) are Done, then transition the issue to Accepted.

As it is, this runs every time anything transitions to Done, and the conditional check of the issuetype = "Deployment Activity" does not seem to prevent the automation from checking all subtasks, regardless of the issuetype parent.

Once all the appropriate conditions are met, the correct issues are being transitioned to Accepted, but it feels like there should be a lighter-weight solution. Any suggestions for an automation neophyte?

![Automation.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/180384i3A7692631941600B/image-size/large?v=v2&px=999 "Automation.jpg")


Answers:
author: Bill Sheboy
body: Hi [@Randy O_Neal](/t5/user/viewprofilepage/user-id/4270808)

You note that your rule occasionally erroring. Would you please show an image of the audit log details and describe the symptom/error you observe is happening? Thanks!

Regarding your rule structure question, you could merge most of your tests on the parent into a single JQL statement, and use a JQL branch instead.

Kind regards,  
Bill

comments: author: Randy O_Neal
body: I've only received this error 3-4 times, and it's always been when evaluating standard story issuetypes:  

Branch rule / related issues  
Error searching for related issues. This is most likely because the following issues don't have a related issue of the type you specified. Try narrowing your search to only include issues that contain links to related issues:  
RACE-9210: "(((key = ) AND (issuetype = "Deployment Activity")) AND (key != RACE-9210)) AND (project in (10060,10061))" - Error in JQL Query: Expecting either a value, list or function but got ')'. You must surround ')' in quotation marks to use it as a value. (line 1, character 10)

I'm hoping the change I've made to further restrict to "Parent Matches" as mentioned below will fix the issue, but I'd like to understand what the error is conveying.


author: Peter DeWitt
body: [@Randy O_Neal](/t5/user/viewprofilepage/user-id/4270808) , my guess is that the error occurs when there is not a parent issue for the issue that was responsible for triggering the automation.

-pjd


author: Randy O_Neal
body: That would make sense... thanks for the assistance. Thanks all!!


author: Peter DeWitt
body: [@Randy O_Neal](/t5/user/viewprofilepage/user-id/4270808) , try adding an additional condition after your When: component like this:

![2022-01-27_14-59-41.png](https://community.atlassian.com/t5/image/serverpage/image-id/180386i36E2D065935EBA0B/image-dimensions/297x203?v=v2 "2022-01-27_14-59-41.png")

This will at least stop the automation from running if the parent does not exist or is of a different issue type.

-pjd
How to use Lookup Issue twice in on rule?
Asked by Mkurama:

Hi, I just want to ask how to use 2 lookup issue with using {{lookupIssues.size}}.

So, how to reference to the first lookup issue.size and secondlookup issue.size. Like the image below.

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


Answers:
author: Manon Soubies-Camy
body: Hi [@Mkurama](/t5/user/viewprofilepage/user-id/4687169),

You can create variables to save values and use them in other actions:

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

Hope this helps!

- Manon

comments: author: Bill Sheboy
body: Hi [@Mkurama](/t5/user/viewprofilepage/user-id/4687169)

Adding to what Manon suggests:

Once you store the values in created variables, you may need to convert them from text with asNumber before performing the math operation you show to set your "progress" field:

<https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#asNumber>

Kind regards,  
Bill


author: Mkurama
body: Thank you [@Manon Soubies-Camy](/t5/user/viewprofilepage/user-id/1215212) and [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) I appreciate that.
Sorting issues under epic by Automation
Asked by Raju Mandapaka:

Can we use use jira automation to sort issues and arrange in serial manner under an epic.

Generally we used to do in backlog epic panel view, is there any chance can we do it using by jira automaion??

Any thoughts please...

Thanks,

Raju


Answers:
author: Mykenna Cepek
body: I'm not aware of any option to sort Epics in the panel of the Backlog view (regardless of Automation).

Automation might help you set a field that you could sort by, but Automation is unrelated to any view of issues (Epic panel, Backlog view, Sprint view, Issue search results, etc).

Some other options for sorting your Epics:

* On a Sprint or Kanban board, specify a filter that includes Epics and sorts as desired.
* Create and save a Filter which sorts Epics as desired. You can even put a hyperlink to that filter in the left sidebar of Jira for the project as a Shortcut, to make it easy to access.
* Use the JQL macro in Confluence to list your Epics and sort as desired.


author: Curt Holley
body: I can't think of how you could do this via automation, where it wouldn't be more complicated than doing it manually.  

The order a team would like to sort the stories for any given Epic feels like something that is squarely in the curate basket, not the automate one.


Tags: addon-com.codebarrel.addons.automation

jira-cloud
Notify when the due date field changes
Asked by Karoline Rezende Ramos:

Hello everyone.

I would like to know if it is possible to create the automation:

1. When the due date is changed (Due Date) to be notified by e-mail  
2. Appear in the body of the e-mail the date that was before and the new date.

The PMO team wants to have control over the due dates and be notified when they change without alignment.


Answers:
author: Mark Segall
body: Hi [@Karoline Rezende Ramos](/t5/user/viewprofilepage/user-id/4342260)

This is totally doable with smart values. Here's a sample on how you would do this:

![2022-01-26_06-54-36.png](https://community.atlassian.com/t5/image/serverpage/image-id/179955i076F5E3C5DF38ED8/image-size/large?v=v2&px=999 "2022-01-26_06-54-36.png")

The key to this is using the changelog smart value:

**Old Value**: {{changelog.duedate.fromstring}}

**New Value**: {{changelog.duedate.tostring}}

comments: author: Karoline Rezende Ramos
body: Wow. Thank you so much!


author: Fr?d?ric Eckert
body: Hello [@Mark Segall](/t5/user/viewprofilepage/user-id/4666637)  

I've previously created this rule, but it's not satisfactory (too much notifications): indeed, I'd like to be able to send an email with the list of tasks whose "duedate" field changed for previous day (sending based on scheduled trigger: e.g. each day at 9:00 am).

The result would be, each morning at 9:00 am:

Hello {{assignee.displayName}},

The duedate changed for this list of tasks:

{{#lookupIssues}}  
\<a href="{{url}}"\>{{key}} - {{summary}} is now set for \<b\>{{duedate.format("dd/MM/yyyy")}}\</b\>\</a\>  
{{/}}

I've made several tests with smart values, but with ni success: do you have some ideas to help me, please?
Rule to create lssue link when there is epic link entered in the story
Asked by Praveen Chitturi:

Dear Team,

We've a JIRA project to maintain in project 1 which is aimed to create the epic. And we have another project 2 which is aimed to create the stories for development work. We're giving the epic link in this development story after the story is created.

For reporting, we've AIO reports. We've a challenge in AIO reports to generate the reports based on the EPIC and issues under this EPIC. As per the other discussion in community it's not possible to list issues under Epic from AIO reporting.

Thus I'm looking to some automation using JIRA Automation. My idea is to create a issue link whenever there is epic link added in the story. I'd done the below automation but the errors are coming when the rule is exeucting.

How can I can pass the value "Epic Link" in the smart value from the edited story? or is there any better way to create issue link when epic link is created?

![image.png](/t5/image/serverpage/image-id/179881i91D6633869624E35/image-size/large?v=v2&px=999 "image.png")

How can we know what are the possible smart values to use in the automation?

Regards,

Praveen


Answers:
author: Vishwas
body: Hey [@Praveen Chitturi](/t5/user/viewprofilepage/user-id/4693004)

Did you try

`{{issue.parent.Epic Link}}`

`To know the list of available smart values, please check this link `

<https://confluence.atlassian.com/automation/smart-values-993924860.html>

`Regards,`

`Vishwas`

comments: author: Praveen Chitturi
body: Hi [@Vishwas](/t5/user/viewprofilepage/user-id/1231381) ,

Thanks for pointing me the smart values documentation. Though the smart value you've provided didn't worked for me but implemented the similar one based on the documentation as below.

With that I'm deleting the existing links for the issue and adding new issue link for the epic.

Thanks a lot for answering this.

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

Regards,

Praveen


author: Vishwas
body: Great !!

Thanks for sharing the answer too, it helps the community !!


author: Gerda Granti?a
body: Hi [@Praveen Chitturi](/t5/user/viewprofilepage/user-id/4693004) ,  
In case you would like to avoid AIO reporting limitations, you can try the eazyBI app for Jira. It has a default epic hierarchy reporting, see an example report here: <https://eazybi.com/accounts/1000/cubes/Issues/reports/789209-story-in-epic-overview-for-unreleased-version-issue-hierarchy>

<br />

And in case you have one project as Master and link epics from other projects, you can create an epic hierarchy without a project, see eazyBI documentation here: <https://docs.eazybi.com/eazybi/data-import/data-from-jira/advanced-data-import-options/additional-issue-hierarchies#AdditionalIssuehierarchies-Epichierarchywithoutprojects>  

best,   
Gerda // support@eazyBI.com  


Tags: data-center