From the JMWE documentation, when I apply any of these three filters to any post function's template and test it from within the post function, it returns nothing. I pass it a valid subtask whose parent that is a standard issue type has an epic link.
These three examples are pulled from here:
Custom Nunjucks filters - JMWE for JIRA Cloud - Confluence (atlassian.net)
I'm trying to understand how to work with these filters, but I guess I'm missing some syntax. If I can figure out how this works, I can apply this knowledge to get what I need. Please and thank you.
{{ issue | parentIssue }}
{{ issue
|parentIssue("status") | field("
fields.status.name
") }}
{{ issue | parentIssue | field("fields['Epic Link']") }}
Your template ran successfully
The first line will display [Object object] because the result is an object (the full parent issue). But if you try this:
{{issue|parentIssue|dump(2)}}
You will see the full details of the parent issue.
However, did you try it on a sub-task that belongs to a company-managed project? JMWE doesn't support team-managed projects.
Hi David. When I run this against a subtask in a company-managed project, it returns nothing. I'm pointing to a subtask whose parent issue has an epic link to an Epic. For testing, I'm just applying this template to a add-comment post function. I've tried this against the 'current issue' and 'parent issue of the current subtask' in the issues to operate on 'Target Issue' dropdown but same result.
{{ issue | parentIssue | field("fields['Epic Link']") }}
Your template ran successfully
Result value:
When I run this against the same subtask issue, the epic link is visible on the parent issue.
{{issue|parentIssue|dump(2)}}
The ID for my epic link field is customfield_11440 but I can't figure out how to pass this instead of its name "epic link" as shown above. At this point I'm just trying to get the epic link to display to understand how these filters work. I can't get any of the filter examples on the linked page above to work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Paul Alexander ,
can you try this :
{{ issue | parentIssue("customfield_11440") | field("fields.customfield_11440") }}
However, using the Epic Link field is not recommended, as Atlassian will be retiring this field soon.
Use this instead:
{{ issue | parentIssue("key") | epic("key") | field("key") }}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This pattern works, David, and I can apply this to other objects now to reach up to the parent and do things like increment a custom field. Thanks again. I couldn't figure out the syntax needed to allow the ID to work. Here they are side by side for comparison.
{{ issue | parentIssue("customfield_11440") | field("fields.customfield_11440") }}
{{ issue | parentIssue | field("fields['Epic Link']") }}
Interesting on losing the special 'epic link'. Here's an article from the mothership.
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.