Forums

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

Using Nunjucks to filter for the current active sprint within a Specific Project

Jonathan Kozma
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 20, 2023

I'm trying to add a post function to a transition where the purpose is to set the value of a sprint in a specific project to an issue. 

To do so, I am using Nunjucks and have the following:

{{ issue | sprints("active") | first | field("id") }}

The problem is that this function, is reading sprints across all projects in our organization, sometimes resulting in an undesirable sprint value being added to the issue.

How can I return the active sprint ID for a specific project / do a check on the sprint name so that it runs again if the returned sprint isn't the sprint I want?

For context, the sprints within the specific project I want to pull from, use a "S##" name format. For the other projects, they use a different sprint name format.

0 answers

Suggest an answer

Log in or Sign up to answer