Forums

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

Automatically Create Issue with an IssueType of "Sprint Goal"

Jamie
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!
March 29, 2023

Hello, I want to automatically Create Issue with an IssueType of "Sprint Goal" and populate the Summary with the Sprint Name, The Sprint Field with the current sprint and the Description Field with the Sprint Goal on Sprint Start.  I'm very new to ScriptRunner so need the baby steps explained! I appreciate any help!!! 

2 answers

0 votes
Jamie
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!
March 31, 2023

Thank you for the help! This is for Jira Cloud, so that may change the advise  you gave above. I do have ScriptRunner. What I want to do is this:

1. Start Sprint (trigger)

2. Create Issue with Issue Type of "Sprint Goal" (I already have this issue type added and available).

3. Add the sprint goal text to the description.

4. populate Sprint with the current sprint.

0 votes
Nic Brough -Adaptavist-
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.
March 29, 2023

Welcome to the Atlassian Community!

I'm going to work through this backwards because I've got answers for the end of the process, but questions about the beginning.

I am assuming you have chosen "server" correctly here (a lot of people don't understand the difference between server and cloud and give us the wrong information.  If you're on Cloud, the principles here are similar, but not the code!)

  • To create an issue, see https://library.adaptavist.com/entity/basics-create-issue?tab=dataCenter
    • This is a relatively new thing, it uses the new HAPI code.  I like to call it "Helpful API" - you can see it says "issues.create" - that's not something Groovy/Jira's Java API do.   Before HAPI, you'd have to create an issue object with a few lines of code, add fields to it, and then run a create function, rather than a single wrapper in something a bit more English.
  • There's no example of setting a sprint in there, but I seem to remember it is as simple as setting a custom field (with the sprint's internal id, I think).  I'll go see if I can find out
  • Question: how do you know which sprint you want to set in there?  And where does the Description (sprint goal) come from

And that leads on to the first step in the process.  When are you doing this?  What is the trigger for it?  Is it a post-function in a workflow?  Or is someone clicking something?  Or it happens regularly?

Reece Lander [ScriptRunner - The Adaptavist Group]
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.
March 29, 2023

I'm assuming this is in response to a "Sprint Started" event, in which case a Script Listener would be the tool to use.

@Nic setting sprints is as easy as:

Issues.create('projectKey', 'issueType') {
setSummary('Summary')
setSprints('Sprint name') // Sprint name
setSprints(100L) // Sprint ID
setSprints(event.sprint) // Sprint from event
}
Like # people like this
Nic Brough -Adaptavist-
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.
March 31, 2023

Thanks Reece!  I've not worked with sprints recently!

Suggest an answer

Log in or Sign up to answer