The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Scriptrunner - Retrieve sprint changelog

Patrick van der Rijst
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 Champions.
October 9, 2020

With using Scriptrunner, you can built listeners and browse through the changelog of what has been modified in an issue. 

I don't see a similar option to do this for sprints, see https://scriptrunner.adaptavist.com/5.6.8/jira/listeners.html for example.

I have a script listener listening on ScriptUpdatedEvent but I only want to continue in my code if the start and or end date have been modified, but I'm not able to retrieve the previous sprint information, is that correct?

2 answers

2 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
PD Sheehan
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 Champions.
October 9, 2020

You get a changeLog with an issueUpdated event because that changelog was needed to generate the Change History data.

There is no change history for sprints. That data simply doesn't exist anywhere.

But it does seem like the event itself contains both the current and previous version of the sprint entity.

So you need to examine if the sprint start date changed, you could try this:

if(event.previousValue.startDate != event.sprint.startDate){
//do something becuase the sprint start date is changed.
}

FYI, since the greenhopper javadoc has not been updated since version 6.x, the best way to find this sort of thing is just with the scriptrunner's script editor:2020-10-09 09_08_16-Listeners.png

Patrick van der Rijst
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 Champions.
October 11, 2020

As there was no doc online about the SprintUpdatedEvent I had to decompile the greenhopper.jar to retrieve those attributes, I didn't know about the autocomplete.. life saver! 

0 votes
Answer accepted
Patrick van der Rijst
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 Champions.
October 9, 2020

Downloaded the source and browsed the .jar file. Found my answer in case it helps others:

log.error "### current " + event.sprint.endDate
log.error "### previous " + event.previousValue.endDate
TAGS
AUG Leaders

Atlassian Community Events