Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,266
Community Members
 
Community Events
184
Community Groups

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!
Mar 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!
Mar 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-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 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.
Mar 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-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 31, 2023

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events