Hi guys, I need your help. I am working on a post-function with JMWE, when I add a new link type and
this is = "It is from the Program", I need to see if there is another issuelink
before this one and delete it,
to leave the new relationship that the user is creating. I am using this code to iterate through the array:
{% if linkedIssuesMap.length != 0%} {% for linkedIssue in issue.fields.issuelinks %} {{linkedIssue.inwardIssue.key }} {% endfor %} {% endif %}
which brings me the issues that are linked:
Your template ran successfully Result value: PPG-1 PPG-2 But I only want to bring the first one (PPG-1) What am I missing to do? Thanks in advance for your help!
Hi @Anderson ,
where are you placing this JMWE post-function? On a transition, or on an Event-based action listening to the issue_link_created event?
If on the latter, then this is the configuration you want:
The Nunjucks condition for the Event-based action is:
{{ context.issueLink.issueLinkType.outwardName == "blocks" }}
The Nunjucks condition for the Unlink Issues post-function inside the action is:
{{ linkTypeName == "blocks" and context.issueLink.destinationIssueId != linkedIssue.id }}
Of course, you'll need to adjust both for your issue link type direction. Replace "blocks" with "It is from the Program" and, if "It is from the Program" is not the "outward" link type direction name (on the Issue Linking admin page), then replace inwardName with outwardName in the first script.
Hi David, and Tx by your answer.
Try to do it from the event, carry out all the steps, execute the corresponding action, but even though the event executes satisfactorily, it does not carry out the action that I expect in the issue that is linked!
I'm trying to do it with a global automation, but it goes into a loop, since I'm trying to leave the last issue that was linked!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Saúl Alexander Mata Velásquez ,
what is happening, or not happening, when the event-based action runs? Also, did you wait a few seconds and then refresh the issue before checking?
Can you share the configuration of the event-based action you have configured?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Anderson
Welcome to the Community!!
We could use Automation for Jira
Trigger - Issue Linked
Condition - Check if the Issue linking is present
Action - If present delete the ones which were used before by using smart values
If we need to check the issue linking when a user links an issue, it's only possible in case we are editing the field when making a transition, field behaviors aren't a thing in the cloud yet!! I guess.
Thanks,
Pramodh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pramodh M
Tx by your answer
This idea is good, but it doesn't work for me, try to do an automation to solve it!
On the contrary, I used a global automation involving all its specifications and also the two projects and their link types, and I added at the end the issue that I needed to link to!
This works but it generates a loop that I have to keep solving
Tx regard!
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.