Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get Issue Key from event.issue?

Colin Mack Nair April 19, 2019

Hello,

I'm using a script listener to make updates to a custom field on an Issue Update event. In order to do this I need the specific key to the issue from the event. I looked at documentation for event.issue. but don't see anything that says "key" or "id". What can I do here?

3 answers

0 votes
PD Sheehan
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.
April 19, 2019

I use event.issue.key 

event is an instance of IssueEvent

event.issue returns an issue object 

And event.issue,key is a groovy shortcut for event.issue.getKey()

0 votes
Ed Gaile _Atlanta_ GA_
Community Champion
April 19, 2019

Colin -

When you say using a script listener are you meaning you are using an app like scriptrunner or power scripts to perform this?

If scriptrunner you should be able to use something like:

issue.getKey()

if Power Scripts you could use something like:

string[] fields;
fields = getIssueFields(key);

-Ed

0 votes
Mikhail Ershov April 19, 2019

If you are using Script runner it should be

event.issue.key

Mike

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events