Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get current sprint name, board name and board ID?

Hizkeel Khan
Contributor
December 16, 2023

Hi,

I have created an automation rule where I am sending an email whenever a new sprint starts. I have added the project name but I want to add sprint name, board name and board ID using smart values in Jira.

For Project name I am using {{lookupIssues.first().project.name}} but if I use the same for sprints then I get all the sprints name. I just want to have current sprint name. 


Please let me know how it is possible?

@Bill Sheboy 

3 answers

1 accepted

2 votes
Answer accepted
Craig Nodwell
Community Champion
December 16, 2023

Hi @Hizkeel Khan check out this post
Or this one.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 16, 2023

Hi @Hizkeel Khan 

Adding to Craig's answer:

I do not believe there is a smart value for Jira boards.  A board (and backlog) is a view based on a filter, and is associated to the project.  There are not that many smart values for non-issue-related things.

If you have one board, you could hard-code it in the rule.

If you have multiple, you could try calling a REST API function (with the Send Web Request action) to get the sprint information with its sprint ID.  That would return the board ID.  And call another function to get the board name.  Here are some references if you want to try this approach:

Kind regards,
Bill

Like # people like this
Hizkeel Khan
Contributor
December 17, 2023

@Craig Nodwell @Bill Sheboy - I was looking for a simpler solution. These Rest API are not gonna work. I thought it can be done through smart values.

I have tried this {{lookupIssues.first().sprint.name}} but it gives me a list of all the sprints. I want to access the current sprint. 

It is easy through JQL when we write opensprints()

{{sprint.endDate.jiraDate}} -> this is not working for me either. 


Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 17, 2023

I do not believe there is another way to get the board information from an automation rule.  As already stated, there are no smart values for boards.  Why would the REST API functions not work, as they can easily be called from an automation rule?

 

Next, let's pause for a moment: what problem are you trying to solve?  That is, "why do this?"  You seem to be replicating information already in the sprint report.  Knowing the problem you are trying to solve may help the community to suggest other solution approaches.  (e.g., email a link to the sprint report instead).

 

Please pause to review the list function documentation before proceeding.  You are using them incorrectly: first does not require parentheses.  https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/

 

For the smart value expressions shown, you are using the lookup issues action, which returns a list of issues.  And you note multiple sprints per issue, and so the sprint field is also a list.  Thus you could try this, assuming the lookup issues JQL contains the issues in the current sprint:

{{lookupIssues.first.sprint.last.name}}

Theoretically, this returns the name of the last sprint added to the first issue found by the lookup.  There are edge cases when it will not work, and please test and adjust, as needed.

0 votes
Walter Buggenhout
Community Champion
December 17, 2023

Hi @Hizkeel Khan,

As @Bill Sheboy mentions, I am not aware of any smart values to retrieve a board name. However, you seem to be over-complicating things here when it comes to the sprint related information.

Since you use sprint created as the trigger for your rule, you can use that sprint to collect related information immediately like this:

  • {{sprint.name}} will return the name of the sprint that triggered the rule.
  • {{sprint.originBoardId}} will return the ID of the board the sprint belongs to (although I am not sure about the information value thereof)

You can even address more sprint attributes like that. See this support article for more information - locate the {{Sprints}} section.

Hope this helps!

0 votes
Asha Goyal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 17, 2023

Hello @Hizkeel Khan 

You can look into:

https://medium.com/@jacobthomasharrison/all-available-jira-issue-smart-values-macros-issue-details-id-keys-608ef5eadd31

where the section is dedicated to the sprint section.

In addition to this, Try, 

{{lookupIssues.first().project.activeSprints.name}} 

and smart value for the sprint name

{{sprint.active.name}}

also, you can try smart value for borad:

{{board.get(boardId).sprint.name}}

Kindly check if this helps and accept the ans if so.

Thanks

Hizkeel Khan
Contributor
December 17, 2023

@Asha Goyal - Thank you for your response. I have tried but I am not getting the result I wanted. 

Hizkeel Khan
Contributor
December 17, 2023

This is what I am doing ...the automation rule triggers when a new sprint is started. 

 

multiple sprints.png

Since I am running multiple boards with multiple sprints, I have to manually enter the sprint url...

Also, the sprint name is not working. 
@Asha Goyal @Bill Sheboy @Craig Nodwell 

Suggest an answer

Log in or Sign up to answer