Notification when issue sprint field changes

Amy Foster February 5, 2015

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

1 vote
Answer accepted
Cesare Jacopo Corzani
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.
February 6, 2015

This is the condition you need

changeItems.any{
    it.field == 'Sprint'
}
Amy Foster February 9, 2015

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

 

 

Amy Foster February 9, 2015

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()

Cesare Jacopo Corzani
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.
February 9, 2015

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

Cesare Jacopo Corzani
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.
February 9, 2015

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

Amy Foster February 9, 2015

Changing the event to Issue Updated worked. Thank you!

Amy Foster February 9, 2015

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()

Darren Lowe February 14, 2019

Hi Amy. Did you ever figure a way to accomplish a notification being sent if the issue is moved in/out of the active sprint? If so, would you mind sharing your script? Thanks!

Like Conner H likes this
Darren Lowe February 14, 2019

@Amy Foster adding this comment in case you didn't get notified from the one above.

0 votes
Cesare Jacopo Corzani
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.
February 10, 2015

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 Sign up to answer