how to create an automation for multiple boards using sprint completed trigger
Asked by Suma Bura:

We want to create an automation which need to trigger when sprint is completed for multiple boards. Could you please suggest a way?


Answers:
author: Keila Rivas
body: Hi!  
I need a rule to close the sprint. I'm confused about "Sprint Completed".  
It's work when the sprint is closed or, to completed the sprint?  

For example. The Sprint K Projected end date: 3/Nov/23 07:00 PM, so I need the rule "Sprint Completed" close the sprint.

Thanks,

Keila

comments: author: Bill Sheboy
body: Hi Keila Rivas,

First thing, I recommend creating a new question rather than adding on to this one. That will ensure more people see it to offer suggestions. When needed, you can add a link back to earlier questions.

For what you asked, the "Sprint Completed" trigger starts when a the sprint is completed by a user for a specific board in your project. <https://support.atlassian.com/cloud-automation/docs/jira-automation-triggers/#Sprint-created--started--or-completed>

According to the Atlassian team members, there are no actions to create, update, or close a sprint for rules. (Although those were listed on the documentation page for quite a while...)

I believe it would be possible to close a sprint with a rule using the Send Web Request action to call the REST API function to update the sprint to "closed". If you want to try that, here are a couple of references to help:

* <https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828>
* <https://developer.atlassian.com/cloud/jira/software/rest/api-group-sprint/#api-rest-agile-1-0-sprint-sprintid-put>

Kind regards,  
Bill


author: Keila Rivas
body: Hi!.

Thanks for your recommendation about the new question. You are right.   

About close a sprint with a rule using the Send Web Request sound like complicated but, I?ll try!

Thank you very much.  

Keila.


author: Bill Sheboy
body: Hi [@Suma Bura](/t5/user/viewprofilepage/user-id/5342829)

I am curious: what problem are you trying to solve by doing this? That is, "why" do this?

* For example, are you trying to reduce duplication / maintenance effort by combining rules?
* Or, are you somehow trying to align multiple-sprint efforts across teams in one project?
* Or, ...

Knowing the answer may help the community to suggest ideas. Thanks!

Kind regards,  
Bill

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

Yes, we are trying to reduce the maintenance and duplication of similar automations by merging them.

Thanks,

Suma.


author: Bill Sheboy
body: Thanks for that information.

What does your rule do when a sprint completes? It may be possible to trigger on something else and eliminate the board-specific dependency.

For example, if you send a report a scheduled trigger could do that for any boards in the project. If instead it does something to the issues in the sprints, that could happen when they are completed / resolved. Either of those would allow one rule to replace several.


author: Bill Sheboy
body: Hi [@Suma Bura](/t5/user/viewprofilepage/user-id/5342829)

Just following up to learn if your question was answered or if you needed more help. If this is resolved, please mark any relevant solutions as "answered" to help others in the community with a similar need.

Thanks!


author: Tim C
body: Hi [@Suma Bura](/t5/user/viewprofilepage/user-id/5342829)

As you probably already know - there's a trigger for "Sprint Completed" ...

<https://support.atlassian.com/cloud-automation/docs/jira-automation-triggers/#Sprint-created--started--or-completed>

![Screenshot 2023-10-17 115731.png](https://community.atlassian.com/t5/image/serverpage/image-id/286697i73FA7F3515A93274/image-size/large?v=v2&px=999 "Screenshot 2023-10-17 115731.png")

Unfortunately, I believe it can only run against tickets within a single board.

Simplest solution would be to duplicate the rule and have each rule running against a different board.

You can create a working rule then easily copy the rule to create clones for other boards...

![Screenshot 2023-10-17 120208.png](https://community.atlassian.com/t5/image/serverpage/image-id/286701i1F7D45E691C34459/image-size/large?v=v2&px=999 "Screenshot 2023-10-17 120208.png")

I hope this helps?

Thanks,

TC.

comments: author: Suma Bura
body: Hi [@Tim C](/t5/user/viewprofilepage/user-id/4438063)  
Thanks for the information. Yes, Currently we are using the sprint completed trigger for singer board and we have separate automations for different boards. We want to merge them to single automation. So, Is there any other way to create an automation for multiple boards in single automation?

Thanks,

Suma.


author: Tim C
body: Hi [@Suma Bura](/t5/user/viewprofilepage/user-id/5342829)

Guess you could use JQL branch to find issues which are present across different boards which are only in closed sprints (and perhaps also not in current of future sprints).

**project in (ABC, DEF) and sprint in closedSprints() and Sprint not in openSprints() and Sprint not in futureSprints()**

Perhaps, also combine with "**resolved \> -14d**" to limit items to only those closed within the past couple of weeks or something similar to meet your needs?

Then look at processing these in bulk within a single automation rule?

Hope this gives some ideas?

Perhaps someone else may also reply with any different options or ideas.

Thanks,

TC.


author: Suma Bura
body: Hi [@Tim C](/t5/user/viewprofilepage/user-id/4438063) ,

Thanks for the suggestion, Will try to use JQL branch.

Thanks,

Suma.