How to retrieve JIRA Agile Bean in Script Runner?

Vasyl Krokha July 26, 2014
Hi, The documentation says Jira Agile bean can be retrieved with @JiraAgileBean annotation - https://jamieechlin.atlassian.net/wiki/display/GRV/Working+With+JIRA+Agile Will it work only for beans from Jira Agile public Java API or any internal service too? Thanks, Vasiliy

4 answers

1 accepted

1 vote
Answer accepted
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.
September 14, 2014
Vasyl Krokha September 15, 2014

Thanks Jamie, I checked the documentation and tried @JiraAgileBean on practice - it works perfectly for all JiraAgile components, amazing! ) I spent a lot of time on trying to achieve the same playing with Spring contects, OSGi imports and so on but failed. May be you could share briefly the approach you used so that it can be reproduced in any third-party JIRA plugin development? Regards, Vasiliy

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.
September 16, 2014

It involves leaping from one private field to another until you get the application context. I have actually posted details in a previous question... in java it would be the same but using reflection, and setting private fields as accessible etc. If I find a better way I will replace it, but I don't think it's going to happen until the JA folks decide they actually want a public API.

Vasyl Krokha September 16, 2014

Yes, I've done something like you've mentioned using existing public API and accessing private fields which represented hidden services which I needed. But it has limitation cause again the set of that fields is quite limited. Getting any service like you do even being some hack approach is the only possible, indeed. You've mentioned you've posted the details on some other question - I tried to search but seems didn't managed to find it. If you could add a link to it here, that would be great.

0 votes
Vasyl Krokha September 15, 2014

JiraAgileBean annotation does the magic of retrieving any JiraAgile bean unlike component-import in P2 plugin atlassian.xml

0 votes
Vasyl Krokha July 27, 2014

Thank you, Jamie

If it works that way then it will save me a lot of time )

Will check it on practice and share the results here

0 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.
July 26, 2014

Should work with any internal service too.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events