How to retrieve JIRA Agile Bean in Script Runner?

Hi, The documentation says Jira Agile bean can be retrieved with @JiraAgileBean annotation - Will it work only for beans from Jira Agile public Java API or any internal service too? Thanks, Vasiliy

4 answers

1 accepted

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

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.

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.

Should work with any internal service too.

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

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Feb 07, 2019 in Marketplace Apps

A Timeless Love Story

It started as any story starts, on a normal, rainy day.   Admin meets App, and her name was Klok2, and like any first relationship we were both trying to make it work but neither one knew what...

442 views 8 26
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you