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

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
Accepted answer

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.

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.

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 ?

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.

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.

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.

> 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.

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.

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.

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

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
Community showcase
Published yesterday in Feedback & Announcements

How do you analyze GC logs, thread dumps and head dumps?

Hi awesome community!  In this article, I would like to describe the one of the toolset (service) for the analyze some problems on different Java-based instances, of course, as Atlassian admini...

62 views 0 6
Read article

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