JMWE Transition - how to access parent issue in a condition

Brett Connor November 8, 2017

Using JMWE in Atlassian cloud, so Nunjucks not groovy.

I want to transition a subtask depending on a criteria of it's parent Story / Bug / whatever. The trouble is, parentIssue is null.

There's reference in the documentation that parentIssue is only set when operating on the parent issue. I read that as for example transitioning the parent issue.

Any way around this? Any way to access the parent in the condition?

2 answers

1 accepted

0 votes
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 8, 2017

In the Transition Issue post-function, only the "issue" variable is defined.

You can still access the parent issue of the current issue, using issue.fields.parent, which returns an object representing the parent issue, as documented here: https://innovalog.atlassian.net/wiki/spaces/JMWEC/pages/108200050/Standard+JIRA+fields#StandardJIRAfields-Parent

However, this object only contains a subset of the parent issue's fields, so you need to make sure the field you're interested in is available by "dumping" it first using the Template Tester:

{{ issue.fields.parent | dump(2) }}

If the field you're interested in is not there, you'll need to use the "parentIssue" filter instead, as described here: https://innovalog.atlassian.net/wiki/spaces/JMWEC/pages/138405679/Custom+Nunjucks+filters#CustomNunjucksfilters-parentIssue

Brett Connor November 9, 2017

Thanks David. I tried issue.fields.parent, it was null using the template tester. At least yesterday it was null. I've tried it again today and it's not, I can only guess that I was probably typing the parent issue key rather than the subtask into the template tester, or something silly like that.

Bonus, I didn't know about dump, that's dead useful.

Thanks for your help.

0 votes
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 8, 2017

In which JMWE post-function are you trying to do this, and on which workflow (issue or subtask)?

Brett Connor November 8, 2017

I'm using "Transition current issue", on a subtask.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events