Forums

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

How does one obtain the handle to an issue being accessed in a Behaviour initialiser?

Luke Galardi
Contributor
January 31, 2019

Hi, 

I have a number of select list (dropdown) fields on my jira form, some of which hold over 500 values.  

I have had success populating these fields from an external source using groovy script in the script console and within the field behaviour.  The issues I encounter are this:

1. As a new issue is created, I want to populate these dropdowns if they have not been populated.  However, I am struggling to find the methods needed to get a handle to the issue being created.  I am using Adaptavist Behaviours and would like this behaviour to execute conditionally each time a new issue is created.  How does one get hold of an issue not yet persisted?

2.  The initialiser appears to execute multiple times when creating an issue.  Is there a suggested alternative location or time in the process for such a script to be contained?

 

Thanks in advance for any advice,

Luke

1 answer

0 votes
Luke Galardi
Contributor
January 31, 2019

I think there may be clues to what I need to do based on this post.   https://community.atlassian.com/t5/Adaptavist-questions/ScriptRunner-Behaviours-how-to-get-information-of-an-issue-when/qaq-p/625146

The suggestion would be to use the underlyingIssue object, as it is representative of an issue which is not yet persisted.  Does this sound feasible?

Suggest an answer

Log in or Sign up to answer