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

Use a file on the Script Editor as a Post Function script

I have script that I need to reuse on a lot of Workflow Post-functions, so I decided to move it to the Script Editor, but now I'm having a syntax issue on this part:

def project = issue.getProjectObject()

#Error: The variable 'issue' is undeclared.

But my 'issue' is the current is which triggered the action.

How can I update this script to make it work as a Post-function?

1 answer

0 votes
Payne Community Leader Jan 22, 2020

Since you're editing your script outside the context of being a post function, the compiler doesn't know what issue is. When it runs as a post function, though, issue will be defined. So, you can ignore the static type checking error while editing the script. I have one like this, and it runs fine.

Suggest an answer

Log in or Sign up to answer
TAGS

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