Notification when issue sprint field changes

We want a notification to fire when an issue is added to or removed from the sprint.  This script did not work.

2015-02-05_8-51-43.png

2 answers

1 accepted

This is the condition you need

changeItems.any{
    it.field == 'Sprint'
}

The goal is to send a notification when an item is moved to or removed from the Active sprint.  We have multiple sprints enabled but there is only 1 sprint active at a time. 

I both of these but they are not firing a notification: 2015-02-09_11-43-52.png

 

and

2015-02-09_11-45-17use.png

 

 

This filter pulls up the data we need, and then if there is a change to this filter we need a notification: project = PULSE AND issuetype = Story and status = ready AND resolution = Unresolved and Sprint not in futureSprints()

The right event should be Issue Updated. Could you try to change the event from Issue Moved to Issue Updated?

Basically you are updating an issue field that reflects the current sprint. If you move your issue that field should not be affected.

Changing the event to Issue Updated worked. Thank you!

Since we have multiple sprints this is notifying too often. Is there a way so a notification is sent only if the issue is a Story and only if the issue is moved in/out of the active sprint? This condition does not appear to work: project = PULSE AND issuetype = Story AND status = Ready AND resolution = Unresolved and Sprint not in futureSprints()

Your condition is a JQL query.
Scriptrunner handles groovy scripts so the native way should be something like:

def sprintChanged = changeItems.any{
    it.field == 'Sprint'
}
sprintChanged && issue.projectObject?.key == "PULSE" && issue.issueTypeObject?.name == 'Story' && issue.statusObject?.name == 'Ready' && issue.resolutionObject?.name == 'Unresolved'

 

 

 

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,854 views 12 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot