Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to Loop Through Multiple Jira Issues for a Project Automation Rule Message?

I'm trying to create an automation rule that gets triggered at the end of every sprint (every 14 days) and searches for epics that have transitioned to the "Done" or "Blocked" status in that time period. Then, I want the action to send a message to a Microsoft Teams room that encompasses the list of those epics that have transitioned in that sprint.

In the chat message, I'd like to loop through the issues returned from this JQL Query so for each issue, the following message would be generated as a single line item in one chat message:

"[{{issue.key}} {{issue.summary}}]({{issue.toUrl}}) was transitioned to {{issue.status.name}}."

Currently, the above line item is only generated for the first issue, so I need to find a way to loop through these issues so that this message gets returned for each issue. Can anyone help?

Example Message.PNG

Below are my rule details:

Trigger step:

Rule Details - Trigger.PNG

 

Action step:

Rule Details.PNG

2 answers

1 accepted

0 votes
Answer accepted

Figured it out. Need to use the following to have the issues loop. Also, using the <a> tag with href attribute does the trick to get the link to work. 


<ol>
{{#issues}}
<li> <a href="{{toUrl}}">{{key}} - {{summary}}</a> was transitioned to <b>{{status.name}}</b>. </li>
{{/}}
</ol>

Hey @andreas, are you able to help me out here? Saw your replies to previous questions somewhat similar to this. Thought maybe you'd be familiar with how to solve this issue.

Please disregard the above. I saw your comment to a previous post and applied that logic. However, it doesn't seem like you can use links in an HTML list (bullet list or numbered). Please see my code below and the result set. Is it possible to create links in some other way in a list?

{{#issues}}
[{{key}} {{summary}}]({{toUrl}}) was transitioned to {{status.name}}. <br />
{{/}}

<ol>
{{#issues}}
<li> [{{key}} {{summary}}]({{toUrl}}) was transitioned to {{status.name}}</li>
{{/}}
</ol>

This produces the below:

Both.PNG

Hi @Brooke Miller ,

I actually build the hyperlinks myself... Tested and it works in an ordered list:

<ol>
{{#issues}}<li><a href="https://jira.abcdef.com/browse/{{key}}">{{key}}: {{summary}}</a> ({{assignee}})</li>{{/}}
</ol>

 

Regards,

Simon

@Brooke Miller 

Very interesting.  How did you acquire the initial issue list by limiting the project, sprint, etc.

 

Thanks,

Carl Davis

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you