Forums

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

Jira - Javascript - Events when issue moved in/out of sprint

Florian Maupas July 22, 2018

Hi,

 

I am looking at a Javascript event that is triggered when a user moves a issue from/to a sprint from the Backlog view (http://localhost:2990/jira/secure/RapidBoard.jspa?rapidView=1&projectKey=TST&view=planning.nodetail)

 

Ideally, I would like to trigger my function after the sprint has been re-rendered again. In the console log I can see the following logs being generated for such events, so I assume this should be possible: 

ui : Redrawing sprint 1
ui : Redrawing sprint 2

 

 

So far the only event I was capable to capture is : 

JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context, reason) {
console.log("NEW_CONTENT_ADDED, reason"+reason);
} );

but it does capture any event while a issue is being moved. 

Would there be any events I could bind against ? 

 

Thanks in advance,

 

Florian,

2 answers

1 accepted

1 vote
Answer accepted
Florian Maupas July 23, 2018

In case anyone is interested, I ended up doing some pretty disgusting hack as I was not able to bind to any javascript event.

I would NOT recommend this solution for any 'production like' commercial plugin but it did the trick for me

 

/**
* Beginning on disgusting hack
* After UI rendering, update the display accordingly
*/
function afterIssueMovedRendering() {
/**
* Your code
*/
}

after(GH.SprintView, '_updateSprint',afterIssueMovedRendering);

function after (object, method, fn) {
var originalMethod = object[method];
object[method] = function () {
originalMethod.apply(object, arguments);
fn.call(object);
};
}
/**
* End of disgusting hack
*/
0 votes
CC August 28, 2020

I am also interested in finding what is the event triggered when moving one issue in/out of a sprint, from the backlog or from another sprint. Do you happen to have a newer answer to this question? Thank you very much.

Suggest an answer

Log in or Sign up to answer