Hello there,
I am a novice in the practice of Nunjucks.
I would like to create a transition Comment Issue (JMWE add-on) to add a comment from a comment on a specific ticket and always the same. This would allow me to outsource the original standard comment message without having to change the programming of the transition.
Maybe using PermaLink?
Thank you for your help or advice
André
Hi,
Using Comment linked issues (JMWE add-on) Function, I found how to get the first comment of the issue and copy it to the parent issue.
{{ issue.fields.comment.comments | first | field("body") }}
However, I can not choose a specific issue where the original comment is. Only the current issue.
However, with Test Nunjuks Template, you can target any issue for testing.
Is there a way to access fields from a specific issue instead of the current issue?
Thank you for the answer.
André
Hi André,
which issue are you trying to access?
You can access the parent of the current issue, it's linked issues and sub-tasks, etc. Or you can access arbitrary issues using the searchIssues Nunjucks filter that allows you to run a JQL expression that returns one or more issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
Thx for your answer.
WRT Parent and linked issue, I am using fluently, np.
For now, template comment is hard-coded into JMWE transistion but I would like to externalize it to allow my colleague to dynamically edit the original.
Yes, I need to access arbitrary issues using searchissue. Where can I find some samples as examples ? I am self-taught in developing my own tool. Not so easy :-)
I appreciate your support.
Regards
André
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are some examples in the documentation: https://innovalog.atlassian.net/wiki/spaces/JMWEC/pages/138405679/Custom+Nunjucks+filters#CustomNunjucksfilters-searchIssues
As for externalizing the template comment, you can use a shared Nunjucks template.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
I am trying your advice through using searchIssues Nunjunks filter but as I am not really an expert, that's the word, I am not able to use the result of this instruction:
"issue=HDF-2" | searchIssues (fields="summary") | dump(2)
The test template ran successfully inside a Set field value post-function and I get
[ { "expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields", "id": "48259", "self": "https://zenelec.atlassian.net/rest/api/2/issue/48259", "key": "HDF-2", "fields": { "summary": "ILLUDESIGN SPRL (HDF-2)" } } ]
But then, how to get the string content of the field summary ?
Thx for your answer
André
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi André,
I believe this is what you're looking for:
{{"issue=HDF-2" | searchIssues (fields="summary") | first | field("fields.summary")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
YESSSS
you make my day very good.
How many times have I not tried combinations!
Have a nice day too :-)
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.