According to the Behaviours documentation, one should be able to retrieve the ID of the parent issue of a sub-task in an initialiser script like this:
FormField parent = getFieldById("parentIssueId")
Am I doing something wrong as parent.value is always null
?
An open issue SRJIRA-253: Cannot get parentIssueId value seems to perfectly capture what I'm experiencing. There are no comments on that issue or any other hints about what could be going wrong. Any hints or pointers would be highly appreciated.
I'm using Script Runner 3.1.4 on JIRA 6.4.1.
What you have above won't work in an initialiser but if its attached to a field it will work. Please see the answer here: https://answers.atlassian.com/questions/17894295
You can use:
underlyingIssue.parentId
Or to get the full issue object use:
underlyingIssue.parentObject
Somehow this was not easy to grasp from the documentation. I ended up not using the initialiser but scripts for individual fields.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.