The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Scriptrunner/Behaviours - How to get Project value?

clem
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 Champions.
November 16, 2016

Hi

Does anybody know how to get the project value from this screen in scriptrunner/behaviour scripts?


2016-11-16_14-15-52.png

 

Thank-you,

Cynthia

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

5 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 Champions.
November 17, 2016

I don't think Vasiliy's example will work on issue create, because there is no issue yet. 

The way to do this which will work in all cases is:

issueContext.projectObject.name

for the name, else you can get the key, or the project object itself.

 

0 votes
Vasiliy Zverev
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 Champions.
November 16, 2016

Assume that you need get Project name on issue create transition. Try this code:

issue?.getProjectObject().getName()