3 Jira automation rules we will cover in our advanced webinar

John McKiernan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 4, 2020

Hi all,

Next week we will be running an advanced automation webinar called ‘How to supercharge your automation in Jira Cloud’. This is the second in our series and this time round, we will focus on 3 powerful use cases. Andreas, who co-built the automation engine and loves sardines, will walk through the 3 use cases below, explaining how it all works in detail. For those who want to examine the rules at their own pace, I will post the 3 rules here also.

Before I do here are other resources that might help:

 

The rules we will cover in the webinar

Rule 1: Send Slack message notifying about all open issues in Sprint

rule-lookup-issues (1).png

In this rule, we are going to use automation to send a Slack message showing all of the open issues left in the sprint. We will be using our brand new ‘Lookup issues’ action that allows you to create reports and notifications for a number of issues.

It can send a daily report of outstanding issues in the current active sprint to Slack. We will also get into the nitty gritty and show you how to use list iteration syntax in smart-values to iterate over a collection of issues (e.g. {{#lookupIssues}} {{key}} {{/}})

 

Rule 2: Sum up story points and keep parent and sub-task in sync

 

rule-sum-story-points.png

This is a new twist on a familiar and common automation rule. Again, we are showing off some new functionality - the ability to aggregate math functions in smart-values. In this instance we show you how you can sum up story points of all sub-tasks and update the parent issue with this value whenever a sub-task's story point value changes

This rule uses a related issue branch to navigate up to the parent issue of a sub-task, and then uses the following smart-value to sum up story points from all sub-tasks: {{issue.subtasks.Story Points.sum}}

 

Rule 3: Notify dev team on PR merge

rule-webhooks-jenkins.png


The feedback from our first webinar was ‘give me more juicy and complex use cases’. Well, Andreas has taken you at your word and this powerful rule is the result!

Again, we will showcase a new feature - our new DevOps triggers, which you can use with BitBucket, GitHub or GitLab. Even if you don’t use a git provider, this this rule will teach some valuable lessons. You can just change the components in and out as suits best.

In this rule, we will react to PR merged events and then notify the Dev team. We will then take this a step further and show you how to build a custom integration with a Jenkins build server using our 'Send web-request' action.

Lastly, this rule showcases that you can even use responses from a third party service (like Jenkins) to perform further actions in Jira! Told you we would dive deep!

It may look intimidating but we will break everything down into bite sizes during the webinar so it is all clear.

We look forward to seeing you all at the webinar! If you haven't already registered, do so now!

John & Andreas

Automation team

 

39 answers

4 votes
Sam Harding
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 17, 2020

Hi Bryan, from the screenshot above, it looks like the rule does not have the 'Lookup Issues' component in its component chain. The Lookup Issues action only defines the {{lookupIssues}} smart value for the Automation rule it is added to, so every rule which wants to use the {{lookupIssues}} smart value must have the 'Lookup Issues' component added to it.

The solution for your use case would be to add the 'Lookup Issues' action after your 'Scheduled' trigger, and before your 'Send Email' action. Let us know if that works for you.

Thanks!

4 votes
Sam Harding
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 17, 2020

Yes, summing up story points is one of the most desired use cases for this feature. We have a number of fields/properties we will be adding to this shortly, with sum up story points being one of the first that will be rolled out.

1 vote
John McKiernan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 24, 2020

That's right Santeri. Apologies, as a non-Dev, I don't want to waste your time so best to cut straight to the experts when I am not sure :) 

1 vote
John McKiernan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 23, 2020

Hey Lucy, 

Jira's default time stamp is in minutes so you will need to add a little math smarts to it. You can see more on this page which will help you:

 https://community.atlassian.com/t5/Automation-articles/How-to-sum-up-logged-hours-using-automation-in-Jira-Cloud/ba-p/1409115

Hope that helps

John 

1 vote
John McKiernan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 18, 2020

Hey @Curt Holley 

You should be able to do this. I have attached a screenshot to show how it might work. Let me know if any issues

image (22).png

1 vote
Curt Holley
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 18, 2020

Hey @John McKiernan  

Do you know if I can (or will be able to in the future) sum up custom numeric fields?

Use case is: The ability to do WSJF calculations in Jira with the help of Automation for Jira. 

Value + Criticality + RR OE = Cost of Delay

Cost of Delay / Job Size = WSJF

1 vote
John McKiernan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 18, 2020

Hey @Santeri Huvinen ,

It should work for you. You can learn a little more about it in this post: https://community.atlassian.com/t5/Automation-articles/How-to-sum-up-logged-hours-using-automation-in-Jira-Cloud/ba-p/1409115

Otherwise feel free to post a screenshot of your rule here and we can look into what might be going wrong :)

 

John

1 vote
Pablo Silva June 12, 2020

Great work guys :)

0 votes
Venkata Ramana Kaza November 13, 2020

Thanks @John McKiernan and @Sam Harding

I am using Schedule trigger and querying for issues using Lookup Issues action. The JQL in the lookup issues is:

Sprint in openSprints()AND statusCategory != Done

The result set is then being emailed. In the email, I am trying to publish the sprint of each issue using {{sprint}}, but that is coming blank.

Based on your responses, looks like this is not possible.

0 votes
Sam Harding
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 12, 2020

Hi @Venkata Ramana Kaza 

John's comment above is how you can access the sprint smart value when using sprint related triggers, so should help you get started with using sprint related automation rules.

Specifically with lookup issues, the sprint field is not supported on lookup issues smart values. This would be the reason your smart values are not working. There are some other ways to work around this depending on your use case, for example a JQL condition could check if the lookup issues sprint match a given sprint name, along the lines of 'id in {{lookupIssues.id}} AND sprint = 'mySprint'. However, direct access of the sprint info for lookup issues is not possible.

 

Cheers

0 votes
John McKiernan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 12, 2020

Hey @Venkata Ramana Kaza ,

think the value you are looking for is {{sprint.id}}

You can see the full list in the screenshot below or on this page

If no joy there, can you tell me what trigger you are using (or better again, send a screenshot of your rule) and also whether you are working on a next-gen project?

Thanks,

John

Screenshot at Nov 13 09-28-31.png

0 votes
Venkata Ramana Kaza November 12, 2020

Is it possible to access the Sprint value of the issues in {{lookupIssues}}? I tried {{sprint.name}}, {{issue.Sprint.name}}, {{issue.sprint.name}}. But none work! Any pointers / help would be greatly appreciated. Thanks in advance.

0 votes
Olga Buslovich
Contributor
September 13, 2020

Will do - Thanks @John McKiernan !!

0 votes
John McKiernan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 13, 2020

Hey @Olga Buslovich ,

For this question, I think it would be best to pop a question through to our support so one of the engineers can answer it. We might need to get into the weeds a bit :) 

John 

0 votes
Olga Buslovich
Contributor
September 11, 2020

@Venkata Ramana Kaza @John McKiernan : I'm trying to figure the same rule for updating / adding comments to ~100 tests in the Test Execution with the date/ Jenkins build and was not successful so far. Please share your rule setting if you find the way of updating jira issues that returned by JQL.

TIA, Olga

0 votes
Venkata Ramana Kaza September 8, 2020

Ok. Thanks @John McKiernan 

0 votes
John McKiernan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 7, 2020

Ah apologies Ramana, I see what you were asking now. 

I don't believe this would be possible. You can't iterate through a list and comment on each. You could set up a second rule with the same JQL that would leave a comment. Not perfect but it might do the trick.

For example:

  • Scheduled trigger with JQL
  • Add comment to issues
0 votes
Venkata Ramana Kaza September 7, 2020

Thanks @John McKiernan. But this is adding the comment only on the first issue in the search result. Not on all issues. Is there a way to traverse each issue in the result set and add a comment or perform any other action?

Regards, Ramana.

0 votes
John McKiernan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 13, 2020

Hey @Venkata Ramana Kaza ,

yes absolutely it would be as easy as adding one more action to the end of the rule to comment on the issue:

Automation rules - Jira 2020-08-14 10-06-12.pngHope that helps!

John 

0 votes
Venkata Ramana Kaza August 13, 2020

Hi,

Is it possible to add a comment on the issues obtained through {{lookupIssues}}?

Regards, Ramana.

0 votes
John McKiernan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 3, 2020

Ah nice, that's a great use case. Thanks for sharing! 

0 votes
JasonB3 August 3, 2020

Thanks @John McKiernan !

Tested and this works!

Untitled.png

 

The Edit issue fields code is:

{
"fields": {
"Story Point Estimate": {{lookupIssues.Story point estimate.sum}}
}
}

 

Thanks again

0 votes
John McKiernan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 27, 2020

Hey @JasonB3 ,

good news, you should be able to do this now. 

Any of these smart values should work: 

  1. {{lookupIssues.Story Points}} 
  2. {{lookupIssues.Story point estimate}}
  3. {{lookupIssues.Story Points.sum}}
  4. {{lookupIssues.Story point estimate.sum}}

Hope that helps!
John 

0 votes
John McKiernan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 23, 2020

Hey @JasonB3 ,

Glad you enjoyed the webinar! Always fun running one. 

At the moment, this is unfortunately not possible. It is an existing 'bug' / limitation :https://codebarrel.atlassian.net/projects/AUT/issues/AUT-1946

The good news, however, is that it is being worked on by one of our engineers at the moment so it should be working within a few sprints. Hesitant to give an exact date but I'll update this post once shipped. 

Hope that helps!

John

0 votes
JasonB3 July 23, 2020

Hello,

 Can I do a SUM function on a filtered list? Scenario: Sum Story Points of all sub task that are not Done.

I can't seem to get the filtered list working. I've tried nesting a math IF function, regex string matching on the collection, and Lookup Issue. I couldn't get any of these methods working in from a variety of syntaxes and permutations. 

BTW, thx for the webinar! @John McKiernan  & @Andreas Knecht . Great stuff!

Suggest an answer

Log in or Sign up to answer