How to write code for post function

1. A global transition (Build JS) added by me in workflow.

2. I have configured a screen having two custom fields with above transition as given below

i) Field one

ii) Field two

On this screen I can see a button called (Build JS)

Now what I want here is after entering the fields detail when user click on Build JS button some piece of javascript code to be executed based on the values of those field.

Please let me know the step by step process to have this working as I am very new to JIRA, so please consider me a baby boy for explaining the things.

I know there is a post-function we can attaché, but when I go to post-function attaché screen I m not able to find a place to write down the code.

1 answer

Hi dude,

You can use a groovy script during your transition.

With Groovy, you are able to get your field values and to write code (java) to execute what you want.

Otherwise you can write javascript into the description area of your fields, but it is not advised.

What do you wanna do with your fields ?

You can't do either of the above in OnDemand.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Apr 17, 2018 in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

764 views 2 19
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you