It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Jira - howto add script code to a workflow transition post-function?

Mathias Buchholz Sep 25, 2012

Hello,

an issue mask contain a cascading select field (an custom field). that mask also has a hidden group select field.

Depending which option is selected from the cascading select field, i want to populate the group select field.

I added the plugin script runner ( https://marketplace.atlassian.com/plugins/com.onresolve.jira.groovy.groovyrunner ).

I found how to intregrate the post-function 'script post-function' to 'create issue transition' . After that you can name a built-in script or the script file path. ...which script path?

  • I have seen samples of script runner for post functions. but havent found how to put that post functions into an jira workflow.

i am a beginner, so the following link isnt enough.

very thanks.

1 answer

1 accepted

2 votes
Answer accepted
vishwajeet singh Sep 26, 2012

Your subject of the question and actual contents are totally different.

Script path is the location of of your script file where you would write code to handle the post function. You can simply embed the script in workflow itself you don't need to write it in a seperate file, coming back to your question on how to put that in workflow go to you workflow postfunctions and add a new post function.

Mathias Buchholz Sep 26, 2012

Hello,

you're right. I changed the content but not the subject.

my problem. I havent found how to embed script code to workflow post-functions.

I know how to add a post function to a workflow transition. then i see the option to use built-in scripts. I don't see an option to input the script code.

vishwajeet singh Sep 26, 2012

did you read this https://studio.plugins.atlassian.com/wiki/display/GRV/Script+Runner#ScriptRunner-Usage

Are you aware how to add a post function in a workflow ?

JamieA Sep 26, 2012

Vishwajeet is correct, in that your question doesn't really relate to what you want to do.

> Depending which option is selected from the cascading select field, i want to populate the group select field

You need to use javascript or the behaviours plugin to do this, or many other solutions, eg sqlfeed, nfeed, dbvalues plugin.

Mathias Buchholz Sep 26, 2012

t read it. I know how to add a post function in a workflow.

the scripting is my problem. I try now working with groovy.

it seems using javascript is not an option.

Mathias Buchholz Sep 26, 2012

Thanks for the hint on the behaviour plugin.

The behaviour plugin could help (creating behaviours; without a condition it also run in the CreateIssue mask?)

Am now trying to insert server-side code.

JamieA Sep 26, 2012

> without a condition it also run in the CreateIssue

Yes. But consider whether you should use it, as it's not yet compatible with 5.1.

Mathias Buchholz Sep 26, 2012

you wrote 'not yet compatible'. is there any timetable for 'compatible'

you named different different solutions. which could you recommend for solving that task? i am new to Jira development, so i like to get any hints.

Mathias Buchholz Sep 26, 2012

thanks for the several hints. i now implemented a script runner post-function into jira.

For writing groovy code IDEA (you could update your doc to v11 ^^) seems better than eclipse.

I hope the next steps are easier.

JamieA Sep 26, 2012

I didn't recommend any particular version of IDEA, no need to update docs.

Mathias Buchholz Sep 27, 2012

meanwhile i solved the issue:

- using Script Runner plugin, writing code with IDEA

- adding a post function to 'Create Issue'

- reading the cascading select field

- depending on selection adding specific user-group users to watch list

thanks a lot

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in Off-topic

Disney Live Action Reboots: Are you for or against?

Happy Friday Everyone! Today marks the international release of Disney's live action version of the animated classic Aladdin. I know that this movie was met with some controversy of over cast...

167 views 21 10
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you