Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to restrict duplicate issues from being created when using a multiselect field in an automation

Jane Ellis November 21, 2024 edited

Hey y'all!

I have an automation that when a field value changes in an Epic (on a multi-select field), I want a Task (not a sub-task) created for each of those field values. I have accomplished this piece... HOWEVER. Now, it creates an issue for each selection every time that field is updated so I'm getting a significant amount of duplicates.

How do I set the automation to only create an issue once for each selection?

Thanks in advance!

2 answers

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 23, 2024

Hi @Jane Ellis 

First thing: I agree with Jim's second suggestion as a good approach:

  • If each created Task is uniquely identifiable in a way that can be matched to the field values with JQL, use a condition (or Lookup Issues) to check for them before attempting to add them
  • You do not describe what happens if a value is removed from the selection field, and that could create other challenges / things to check

 

Another way to solve this is to try using the {{fieldChange}} smart values to check for added values: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--fieldChange--

This does not work for all fields, and so you will need to experiment first with a test rule, perhaps writing to the audit log to observe what happens:

  • trigger: field value changes for your custom field
  • action: log
    • check if added values: {{addedfieldChange.values}}
  • action: log
    • check if deleted values: {{deletedfieldChange.values}}

If it accurately returns the added / removed values, you could use them and an Advanced Branch to create the tasks.

 

Kind regards,
Bill

0 votes
Jim Knepley - ReleaseTEAM
Atlassian Partner
November 21, 2024

Hi @Jane Ellis 

I don't think that you can trigger automation for only changed items when a multi-select field is updated.

To work around that, you'll either need to:

  • track the field values and calculate which values have been added, removed, or are unchanged when the field is updated. This isn't technically difficult, but would probably require something like ScriptRunner.
  • check if an issue that the automation would create already exists. This might be the easiest solution, as long as you can figure out the query.

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira cloud certification, managing jira projects, jira project administration, jira cloud exam, atlassian certification, agile project management, jira workflows, jira permissions, jira training, jira cloud skills, atlassian learning

Become a Certified Jira Service Project Expert 🦸🏻‍♂️

Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.

Get Certified! ✍️
AUG Leaders

Atlassian Community Events