How to create post workflow function to update field of linked issue?

How do I create a Post Workflow script to set a Multi Checkbox Field to specific value IFF issueLink = blocker?

Can you provide some instruction on how I could modify the 'add comment' post workflow script (which provides similar behavior) to perform allow this capability?

3 answers

0 vote

Put the following code in a file on your server:

https://gist.github.com/jechlin/6003129

Adjust the script where I have marked.

In your workflow, add new script post-function. Instead of using a built-in script give the path to this file.

This should be the FIRST post-function in the list.

I am trying the script now... just didnt know where on the server I should place it. I was assuming it would need to be in the install dir somewhere (and would prefer that as its less likely to get 'lost') but will do as you instructed.

It's best to be outside, so it survives an upgrade. Personally I have everything in a directory "../scripts" which is relative to the working directory.

Its not working. Im not sure if its because the field Im trying to change is the builtin 'Flagged' or if its not detecting that the issue being transitioned is a 'Blocker'. I cant find anything was writtent to the log (error/info notice) either.

Ok, so I was able to at least get the script to write a 'debug' line to the StdOut log. I suspect its not detecting the issue is a 'blocker' for some reason (so its not getting into the If{}...

Ill poke around and see what I can find. If you have any suggestions I would appreciate them.

Thank you so much for getting me started on this, there are many thing I want to use similar functionality for :)

Have you considered allowing the saving and linking of a script from the "script console"?

What is a recommended location in the jira installation tree that this file should be placed so it is maintained thru updates etc?

0 vote

Did you try the script?

It doesn't matter where you put, except it should be outside of the installation directory.

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
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

365 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