Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Jira Automation To Create New Issue Based On Field Value - Suggestions?

Gail
Contributor
October 24, 2022

Hi Community!

I have 4 custom fields that are multi-select list.    I need to be able to automate creation of a task (name of new task is based on custom field value selected), linking the newly create task to its "parent" and assigning the task.

My rule currently works only when a SINGLE VALUE is selected in one of my 4 custom fields.   The rule also has over 65 components so I have to split it into multiple rules..  I want to make sure I am doing it the most optimal way.    

USE CASE

We have a JWM project with a form for customers to submit an issue.   That form has 4 custom fields that are multi-select list.   There are a total of 27 values that can be selected from these 4 fields.

Based on the value(s) selected in the form for these 4 custom fields I need to:

  • Create a new task (one task for each form value selected) with a specific name
  • Link that new task to the original form issue 
  • Assign the new task to a person

RULE NOW

  • TRIGGER = when new issue is created
  • CONDITIONS
    • labels = business-form (JWM creates this when a form is used to create an issue)

IF BLOCK

  • CONDITION = JQL Condition (Example: "Marketing Content Development Support[Select List (multiple choices)]" = "Content Creation - Webinar")
  • ACTION = Create issue named "ABCD"
  • ACTION = Link newly created issue to original form issue
  • ACTION = Assign newly created issue.

 

This is just the very first section as too long for print screen!

Screen Shot 2022-10-24 at 10.06.39 AM.png

 

How do I write a rule that works when one or many values are selected in one of my 4 custom fields?

Thanks in advance!   

 

1 answer

1 accepted

0 votes
Answer accepted
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 24, 2022

Hi @Gail - So, it would help to have an understanding of the full context of the rule.  This one can go down a rabbit hole really quick.

  1. What is the rule doing besides spawning new rules that requires 60+ components or is that what it's come to as you've tried to capture every possible permutation?
  2. What are each of the 4 fields intended to do? 
    1. Are all 4 fields contributing to the summary of the target issue (e.g. Summary is "Field1 Field2 Field3 Field4")?
      or
    2. Are each of the fields a source for separate issues (Issue 1 summary = Field1, Issue 2 summary = Field2, etc.)?

This will help in understanding how to proceed.

Gail
Contributor
October 25, 2022

Thanks Mark.

The 4 custom fields are created to capture the type of work that a customer can request from this team.   They wanted 4 vs 1 because they have 4 business areas.  The fields are all multi-select list.   We had thought about using components for this too, but that field can't be used on the JWM form.

To answer your #1 - These custom field values are "mapped" to a specific dev task name that goes into summary.   EX:  field value Design Activation - Social needs a new dev task created named Design:  Social asset. 

The fields are not specific to any issue to answer your #2.

Their ultimate goal was to have the customer complete the JWM form requesting work and have that form create an epic; however, this is not possible with JWM per Atlassian Support.    They are OK with having the form create just a task.   

That form created task represents their "project" so they need to create one development task and link that new dev task to the original form-created task.

The difficulty is that each potential custom field value a custom can select needs to have a set "linked dev task" name.   We also have to put that set task name in the description as it is a required field.

I don't know if using variables is the route to take or what is best.    As a callout - we don't have any Marketplace add-ons, and unfortunately we cannot install any so any scripting won't work.

Thanks in advance!

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 25, 2022

Thanks, can you please confirm my understanding?

  • Each field can have its own series of tasks
  • For every new form submitted, you will have anywhere from
    • 4 different tasks (user selected one value from each field)
      to
    • 27 different tasks (user selected every possible value)

If this is correct, you could do something like this:

  • TRIGGER: Issue created
  • BRANCH (Advanced) varField1
    • {{issue.field1.value}}
    • ACTION: Create Issue
      • Summary = {{varField1}}
      • Linked Issues YOURLINKTYPE - Trigger Issue
  • BRANCH (Advanced) varField2
    • {{issue.field2.value}}
    • ACTION: Create Issue
      • Summary = {{varField2}}
      • Linked Issues YOURLINKTYPE - Trigger Issue
  • BRANCH (Advanced) varField3
    • {{issue.field3.value}}
    • ACTION: Create Issue
      • Summary = {{varField3}}
      • Linked Issues YOURLINKTYPE - Trigger Issue
  • BRANCH (Advanced) varField4
    • {{issue.field4.value}}
    • ACTION: Create Issue
      • Summary = {{varField4}}
      • Linked Issues YOURLINKTYPE - Trigger Issue

This branches on each of the four fields.  For each field, you're iterating through the selected value, creating a new issue, setting the summary to the current iteration and linking the newly created issue to the trigger issue.

Gail
Contributor
October 25, 2022

sorry for the confusion -- this one is ugly.

On the form the user can select 1 or many values from one custom field OR all custom fields.   

4 custom fields + their values:  (( See below for screenshot of fields on our form ))

 

CUSTOM FIELDValuesTask Names
Marketing Content Development Support[Select List (multiple choices)]Content Creation - Blog/Press releaseContent: Blog/Press release
 Content Creation - WebinarContent: Webinar 
 Content Creation - Content downloadContent: Content download
 Content Creation - VideoContent: Video
 Enablement - External/internal resourceContent: Enablement resource
Marketing Design Support[Select List (multiple choices)]Design Activation - Short docDesign: Short doc
 Design Activation - Long docDesign: Long doc
 Design Activation - IllustrationDesign: Illustration
 Design Activation - InfographicDesign: Infographic
 Design Activation - Ads/Paid mediaDesign: Ads/paid media
 Design Activation - SocialDesign: Social asset
 Design Activation - VideoDesign: Video asset
 Design Activation - WebsiteDesign: Website asset
 Design Activation - EventsDesign: Events asset
 Design Activation - Printed materialsDesign: Printed materials
 Design Activation - SwagDesign: Swag
 Design Planning - Creative concept/wrapperDesign: Creative concept/wrapper
 Design Support - CanvaDesign: Canva support
Marketing Ops Support[Select List (multiple choices)]Mops Activation - Ads/DigitalMops: Ads/Digital
 Mops Activation - Content downloadMops: Content download
 Mops Activation - Direct mailMops: Direct mail
 Mops Activation - Email(s)Mops: Email asset
 Mops Activation - WebpageMops: Webpage 
 Mops Activation - Webinar/Virtual eventMops: Webinar
 Mops Activation - List importMops: List import
 Reporting - Analysis/QAMops: Reporting/QA
Marketing Social Support[Select List (multiple choices)]Social ActivationSocial: Activation

_____________________________________________________________________

 

Screen Shot 2022-10-25 at 9.39.45 AM.png

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 25, 2022

What I proposed should hopefully handle that. If they, say only select something for Field1, the other branches will quickly exit because there's nothing to iterate against.

Gail
Contributor
October 25, 2022

I will give it a go.  Thanks!

Gail
Contributor
October 26, 2022

Hi @Mark Segall hopefully last question.....    

How does the advanced branching work with a custom field?    I tried the code below, and it failed.    Sorry -- I have never used variables and advanced branching before.   

Screen Shot 2022-10-26 at 8.16.04 AM.png

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 26, 2022

Can you please either copy/paste the error or share a screenshot of the rule log? 

Gail
Contributor
October 26, 2022

The provided smart value was unable to be resolved to an object.

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 26, 2022

Can you try just using this for the smart value?

{{issue.customfield_10357}}
Gail
Contributor
October 26, 2022

same error - The provided smart value was unable to be resolved to an object.

Gail
Contributor
October 26, 2022

I think it is {{customfield_10357.value}}

That worked.

Like Mark Segall likes this
Gail
Contributor
October 26, 2022

@Mark Segall now my next dilemma......

ACTIONS:

  • used form to create new task - selected 2 values from the first custom field (10357)
  • In my create new issue action I could only give ONE summary.   I used This is the test - ds branching spawned issue" below. 
    • I need each spawned task name to be different based on the values selected.

SPAWNED TASK NAMING:

In custom field 10357 - if user selects value

  • Content Creation - Blog/Press release then the task summary should be Content: Blog/Press release
  • Enablement - External/internal resource then the task summary should be Content: Enablement resource

 

Is something like this even possible?

 

Screen Shot 2022-10-26 at 9.42.28 AM.pngScreen Shot 2022-10-26 at 9.42.00 AM.png

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 26, 2022

Your summary is static.  If you want it to dynamic capture the current iteration of the field value, you'll need to use {{DS}} in your summary line.

Gail
Contributor
October 26, 2022

that is exactly what I did in my last test.   It is still generic BUT it is closer than the previous attempt.   Thanks so much for all your help!!

Screen Shot 2022-10-26 at 10.08.34 AM.png

Like Mark Segall likes this
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.
October 26, 2022

Hi @Gail 

Adding to Mark's answer...One easy way to add the extra, conditional text to your summary is with conditional logic.  For example:

{{DS}} - some static text, as needed - {{#if(equals(DS, "Content Creation"))}}Blog/Press Release{{/}}{{#if(equals(DS, "Enablement"))}}Enablement Resource{{/}}

Just add this pattern to the end for each one you need:

{{#if(equals(DS, "value to check"))}}value to add in summary{{/}}

You would need to maintain this as your values change, but it is a quick solution to the need.

Kind regards,
Bill

Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events