Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Mathias Buchholz September 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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
Vishwajeet Singh
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.
September 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 September 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
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.
September 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
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.
September 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 September 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 September 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
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.
September 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 September 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 September 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
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.
September 26, 2012

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

Mathias Buchholz September 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

TAGS
AUG Leaders

Atlassian Community Events