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 Leaders.
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

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

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

issue?.getProjectObject().getName()

Suggest an answer

Log in or Sign up to answer