Forums

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

I am trying to call some code on state change of an issue(to-do-in progress)

kunti pawar May 9, 2018

I am trying to call some code on state change of an issue(to-do-in progress).

How we can call the code using script runner?

3 answers

0 votes
Ajit Rajput
Contributor
May 9, 2018

When you click on the Transition(id), the Transition screen will show up. Select the Post Function tab and click on "Add Post Function"

A new screen will open, asking you to select the type of function you wish to implement. In your case, since you want to call custom code, you need to select "Script Post-Function" option from the list and click on "Add". In the next screen, select "Custom script post-function" which will allow you to script your groovy code in the blue text box.

Hssh !!!  That was too much of typing for me. but hope this will help you.

kunti pawar May 9, 2018

Hi Ajit Rajput,

Yes it is rally help for me.

Thank you so much :)

kunti pawar May 10, 2018

Hi Ajit,

Now I want to generate log on click To Do button(workflow).

Can you please let me know? 

0 votes
kunti pawar May 9, 2018

Thanks  Alexey Matveev COMMUNITY CHAMPION.

It is really useful for me.

now I am looking post function :)

Script runner is required for the same purpose?

0 votes
Alexey Matveev
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.
May 9, 2018

You should open the issue workflow in the edit mode. Choose the transaction, which leads from the TO DO status to the In Progress status, add Script Post Function and write there your script.

kunti pawar May 9, 2018

Thanks Alexey Matveev COMMUNITY CHAMPION for quick response.

I am new user for Jira and script runner.

But I followed your step but I am not understand (what exact choose transaction from the TO DO status)

can you please let me know what exact I should do for the same.

Alexey Matveev
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.
May 9, 2018

What is the button called which leads from the To Do status to the In Progress status? Transaction has the same name. Here is my screenshot:

Selection_073.png

kunti pawar May 9, 2018

Thanks Alexey Matveev COMMUNITY CHAMPION.

kunti pawar May 9, 2018

It is really useful for me.

now I am looking post function :)

Script runner is required for the same purpose?

Alexey Matveev
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.
May 9, 2018

You need to install ScriptRunner first. Then when you add a post function you will be able to choose the Script Post Function.

kunti pawar May 9, 2018

Thank you so much

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events