Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

how to get current editting issue object programmingly in Behaviours Plugin?

fabby June 5, 2012

someone knows any method to get current editting/resolving/closing issue's object?

or can we use javascript to get the issue's id ?

my jira version is jira 4.4.1

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

4 votes
Answer accepted
Mizan
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.
June 5, 2012

Hi Fabby ,

Try the below code

Object id = getFieldById("id")

MutableIssue missue=ComponentManager.getInstance().getIssueManager().getIssueObject(Long.parseLong(id.value))

fabby June 5, 2012

Mizan,thanks very much!

3 votes
JamieA
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.
November 8, 2012

Better to use getUnderlyingIssue() assuming you're using a recent version.

The other examples will work, but will fail with a null pointer exception if the script is on create.

1 vote
Srividhya November 8, 2012

try this

def issueId = formContents["id"]

def issue = componentManager.getIssueManager().getIssueObject(issueId as Long)

This will fetch "Issue " Object

TAGS
AUG Leaders

Atlassian Community Events