How can I get user action in a post function script

I would like to get a user action name (e.g. Create, Clone, etc.) inside a post function to alter workflow depending on the action. For instance:

  1. When a user clicks Create to create a new issue the post function script sets Description field to a specific value.
  2. When a user clicks Clone on an issue the post function script does not perform any actions.

Script Runner's Behaviours offers a predefined function to get action Name: getActionName().

2 answers

Hello Bartosz.

I suppose you can create a Custom Script like this:

if (getActionName() == "Create Issue") {
issue.setDescription("Your new description")

This should work as is your Custom Script postfunction dialog.

If this isn't what you wanted, please let me know and expand your examples.



Thank you for your response, @Daniel Yelamos [Adaptavist]. The getActionName() function won't work inside custom script for post-function. Event the script editor does suggest this function is unavailable.

Screen Shot 2017-09-29 at 11.23.31.png

Hi Bartosz

I'm sorry I pointed out to the wrong thing. As a matter of fact we have an article of this in our documentation that I totally overlooked.

Apologies once again, I hope this was what you were looking for



Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 13, 2019 in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page


242 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