How to get issue id on issue create event?

Gaurav Jain July 2, 2019

I am new to JIRA I want to get newly created JIRA id in my script i am using power script also i want to get the field values at the time of issue create event.

1 answer

1 accepted

0 votes
Answer accepted
Krishnanand Nayak
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.
July 2, 2019

you can use : 

Issue createdIssue = event.getIssue()

Then you can use the "createdIssue" to get the data in all the fields when the issue was created.

Gaurav Jain July 2, 2019

Hi Krishnanand,

Thanks for reply. As iam completely new to JIRA.i am using this script in listener issue created . now when issue is created in jira then i want to capture issue id and then i want to perform operations. Will above code will work which u gave. If yes how to check whether id is there in logs

Krishnanand Nayak
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.
July 2, 2019

Yes it will work when you configure your listener for Issue Created event. here is how your setup will look like:

listner.png

Gaurav Jain July 2, 2019

Thanks it worked.

 

is it possible to get all fields of that issue created. Also I want to execute jar files

Krishnanand Nayak
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.
July 3, 2019

check out https://library.adaptavist.com you will get examples

Suggest an answer

Log in or Sign up to answer