Is there any way to automatically populate an issue's custom field's value with its sprint goal?

Emeka Mbazor February 3, 2020

I want to be able to use this custom field to filter through issues with the Confluence Jira Issue macro by sprint goal. I know that this isn't available out of the box because the developers explicitly chose to separate the sprint goals field from it's issues completely ( https://jira.atlassian.com/browse/JSWSERVER-7308 - "[The sprint goal field] would be independent of the work being done on the Issues, and only linked to the Sprint as a whole."). I was wondering if there was a way I could set up a custom field for issues that automatically pulls from its sprint's sprint goal field.

2 answers

2 accepted

1 vote
Answer accepted
Fernando Bordallo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 3, 2020

I wonder, how different would this be from finding issues based on a particular sprint? After all a sprint goal maps one to one to a sprint

Emeka Mbazor February 3, 2020

Yeah. I'm hoping there's someway they could be related. Do you think it's possible to connect the two with the programming a Jira app? I tried looking at their tutorials and I think it's possible but I don't think their tutorials are going to get me anywhere close to being able to do that.

Fernando Bordallo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 3, 2020

Well, potentially (potentially 😋) you could do this with ScriptRunner. On issue creation/update you could look into the sprint value and the make the appropriate requests to grab the Sprint goal and add it to the custom field :)

https://marketplace.atlassian.com/apps/6820/scriptrunner-for-jira?hosting=cloud&tab=overview

Like Emeka Mbazor likes this
Emeka Mbazor February 3, 2020

Ah, and I would make the field hidden only. Thank you.

Like Fernando Bordallo likes this
Fernando Bordallo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 3, 2020

🚀

Emeka Mbazor February 3, 2020

Hey @Fernando Bordallo  I was wondering how can I access a sprint's field in scriptrunner? Or should I make a separate thread for help on that? I'm looking at their documentation and they only mention requests on issues.

Fernando Bordallo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 3, 2020

Good question 🤔 @Nic Brough -Adaptavist- , thoughts on this?

Fernando Bordallo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 5, 2020

Sure! If you can hit that API in the same context as your scriptRunner code you can surely share the responses :)

Emeka Mbazor February 7, 2020

@Fernando Bordallo Thank you again. It works.

Like Fernando Bordallo likes this
Fernando Bordallo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 9, 2020

🚀awesome

Like Emeka Mbazor likes this
0 votes
Answer accepted
Emeka Mbazor February 7, 2020

For future reference for anyone wanting to do the same... It's a very technical, code-heavy solution

You need Scriptrunner for this. With Scriptrunner, you can write two scripts that run on Issue creation/update and Sprint creation/update.

 

I recommend you use the Jira Software API and not the normal API because issues don't have their own sprint information in the normal api... https://developer.atlassian.com/cloud/jira/software/rest/

Suggest an answer

Log in or Sign up to answer