I want to read value of links created by Portfolio for Jira in Jira plugin. I have check that there is custom field "Parent Link" created by Portfolio plugin but it seems to be not populated and always return 'NULL' value.
I want to read value of parent and child of given issue in Portfolio hierarchy in Jira plugin using Java.
Hello @DPKJ
I am able to use the custom field "parent link" using Jira Java API. I use the value of this field quite a lot in the many scripted fields I have in the script runner plugin.
Please see code sample which I have posted as an answer here
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have looked into that answer.
My issue is what does below code return?
issue.getCustomFieldValue(parentLink);
Can please tell me type of Object? Is it internal to Portfolio Plugin or is it standard Java issue type?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is the exact question I had asked in the link which I posted. The type of object is not documented but it does return the issue key using the ".key()" method. Once you have the key then you can use IssueManager to get the complete issue object and then perform any desired operation on it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My problem is I can't add direct dependency to Portfolio so that my plugin can run without it also.
So it is important for me know what type of Object does it return.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @DPKJ
Currently it's an open ticket for parent link to behave link epic link and the Java API for portfolio is also not available yet (REST API is available but not Java)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @DPKJ
If you feel that my answer has helped you, then please accept/upvote so that others are also helped.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sure,
I read value using reflection api provided by Java.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello DPK,
Is the field populated? That field displays the parent issue of the issue you are, if the issue you are searching does not have a parent issue then you will get a NULL.
I recomend setting up the hierarchy, making sure you make a issue parent of another. Add the field Parent Link to the issue, so you can see for sure that, that issue has a parent link. Then start testing, if you have not populated that field first, it is impossible to get a result.
When you add the field parent link, you can even add it to the edit screen to populated it outside of Portfolio (but remember is a Portfolio field, so you probably need Portfolio permissions)
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks. I have searched for issues where "Parent Link IS NOT EMPTY" and there are some issues and I have run plugin code on those issues, and still I'm getting NULL as output for custom field value.
But I will reverify it on new installation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.