I have some tasks in Jira and one field has some values. I have to create tasks in different projects based on values in that field. I can create tasks successfully but I am having an issue. I want to make sure that an issue is not created for the second time if it was created and linked to that ticket once. I am able to create a link between the both issues using clones Link. But, it always creates duplicate issues everytime the issue is updated. I am unable to get a logic to create the issue once only. I have tried adding the second condition that is shown in AND but it does not work
Here is my current automation rule.
This is the variable called relatedCT.
This is for-each
This is the create issue
This is my logic here
de-duplicate logic: this is to ensure for each issue in CM1, only 1 issue is created in one of the slave projects. for instance, for CM1_1, in CT1, there should only be one issue created for CM1_1.
The duplicate could happen in these scenarios: 1. more than 1 question in CM triggers the creation of a new issue. There will be about 30 questions. Some questions are multiple-select. so there will be about 60 data points. it would be hard to control the questions so they do not result in duplicate issue creation. therefore we need a backend logic.
Here is the value in the custom field mentioned in my rule
CT163,CT162,CT161,CT160,CT156,CT155,CT153,CT149,CT146,CT137,CT116,CT83,CT82,CT81,CT79,CT66,CT60
I have made sure that these values are never duplicated via the scriptrunner script while setting these values here.
Now, I have a concern that if the issue is updated a second time, it should not create the tickets again and link them to the current issue.
Hi @Jamshaid
How do you determine if an issue is a "duplicate"? Is the branch variable {{customCT}} used to set a value in the new issue so it can be checked for uniqueness?
Please show an image for the Create Variable action of {{relatedCT}} to clarify the input values to the branch.
Please show how you are are selecting different projects in the Create Issue action.
Kind regards,
Bill
Hi @Bill Sheboy , i have updated my question. COuld you please look into it again?
THanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the additional information, @Jamshaid
FYI - you describe the removal of duplication in the custom field using a ScriptRunner script. That could be enforced further in the advanced branch by using distinct:
{{relatedCT.split(",").distinct}}
You appear to be making the new issues unique by concatenating the values of the trigger issue's key and the branch variable, {{customCT}}
However your rule does not check if any issues exist that match that pattern with the Related Issues Condition's JQL. Perhaps add that also using the DOES NOT CONTAIN !~ JQL operator:
project = CT163 AND summary !~ "{{customCT}}"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy thanks for further guidance.
The JQL does not support using smart values. How do I avoid duplication of issues in this case?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In an automation rule, smart values can be used in JQL. The expression I suggested is what will detect any duplicates.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jamshaid ,
You can add a condition using the Summary !~ "created issue summary" before creating the Issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
how would i do that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Manoj Gangwar Is not there any other way? The summary might be different for the issues created.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jamshaid
There seems a bit of a mismatch of variables in your automation.
{{relatedCT}} is defined, yet {{customCT}} is used (twice). As the latter is undefined, it yields a null object that never triggers your conditionals.
Hope your automation will at least run after this,
Dick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Dick for responding. I have used customCT variable in branch and have defined it in the branch as well. You can see my configurations for this variable. I believe that is not the case
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jamshaid
I think the text under the advanced branch inlay in your picture tells you not to split the stuff as it is carried out for each value in the list.
And for clarity, can you whip up the definition of relatedCT as well ?
Thanks for clarifying your problem,
Dick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for the confusions @Dick
I have comma separated values in the relatedCT custom field. I have to create a different task in a different project based on each value. Task creation works fine as I mentioned in my question but the issue occurs when it creates duplicates. I want only single issue created
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To assess the duplicates: do you see a double round of statements in the automation log?
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.
Hi @Jamshaid
from the log, I conclude that the foreach loop only is run for the log action. The condition check is only run once.
Shouldn't your logs contain as much condition checks as there are entries in the relatedCT variable?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dick I have updated my question adding more details. Could you please have a look at it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jamshaid , I've read your updated question three times.
I think your logic would have to address an occurring change to the original ticket in the master project. You can do so by using the change history to access the previous and current value, then determine if action (creation of a ticket in the slave project) is warranted or not. Assessment goes like this:
Old Value: {{changelog.[fieldname].fromstring}}
New Value: {{changelog.[fieldname].tostring}}
I think that if the old value is empty, you should create the ticket, and when it's full, this action would not be necessary (or maybe a change in the slave-ticket might be in order).
Curious as to whether I've interpreted your renewed query
Dick
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.