Forums

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

Help with script of Transition Linked issues with scriptrunner

Laura Carbonell
July 15, 2021

Hi!. 

I'm trying to create a script with scriptrunner to be able to tansition two linked issues that, each from different projects. What I want is that when one of these issues goes to "done", the other one does it automatically. 

¿Does anyone have an example of a script i can use?

¿Do i have to select a postfunction or a condition in scriptrunner?

I'm new in groovy and I'm lost!

Thanks!

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Jonathan Rosenberg
Contributor
July 25, 2019

What works for me is to include the form handling script inside the dialog string in the REST endpoint, instead of adding it as a resource. Before your form code, add the handling JS in <script> tags.

 

Also in the script block, for POST, try XMLHttpRequest

var xhttp = new XMLHttpRequest();

xhttp.open("POST", "${baseUrl}/rest/scriptrunner/latest/custom/restendpoint", false);                    

xhttp.setRequestHeader("Content-type", "application/json");                    

xhttp.send(JSON.stringify(payload));
TAGS
AUG Leaders

Atlassian Community Events