Create Multiple Jira Issues Based on a Custom Number Field or variable Using Automation

Patricia Francezi
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 25, 2024

3 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.
July 25, 2024

Hi @Patricia Francezi 

You appear to be following the technique I wrote a while ago...which replaces the value of a created variable, but your variable names are not identical: one is varloopValues and the other is varLoopValues.

Smart values are name, spacing, and case-sensitive.  When an incorrect / unknown smart value is used, it is replaced by null, leading to unexpected results or errors.

Please try updating the capitalization of your variable names so they match and then re-test.

 

Next, did you confirm the smart value for your custom field, {{issue."Teste automacao"}}?  You could write that value to the audit log to confirm it is correct.  As noted earlier, if an incorrect smart value is used, it is null.  You may find the correct smart value using this how-to article: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

 

Finally, and just to confirm, what is the type of your field driving the loop: {{issue."Teste automacao"}}?  If it is not a number field, it will need to be converted using asNumber.

 

Kind regards,
Bill

Patricia Francezi
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 25, 2024

checking

and its a field number, yes.

i was trying to use the variable from the automation manual menu, so changed to a field, wondering if the variable is a number or not. 

but the field is a number 

 

 

 

  {
    "id": "customfield_11772",
    "key": "customfield_11772",
    "name": "Teste automacao",
    "untranslatedName": "Teste automacao",
    "custom": true,
    "orderable": true,
    "navigable": true,
    "searchable": true,
    "clauseNames": [
      "cf[11772]",
      "Teste automacao",
      "Teste automacao[Number]"
    ],
    "schema": {
      "type": "number",
      "custom": "com.atlassian.jira.plugin.system.customfieldtypes:float",
      "customId": 11772
    }
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.
July 25, 2024

That appears to be a number field.

Please add writes to the audit log after each Create Variable action to check if the value contains what is expected. 

If the second variable created is incorrect, the symptom I would expect is only one loop of the branch, which is what appears to be happening.

Patricia Francezi
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 25, 2024

after changing the variable names to be the same - it didnt work, but when i changed the issue field to 

issue.customfield_11772

it worked . THAAAAAAAAANK YOU!

BUT dont leave me @Bill Sheboy LOL 

If I want to add the numbers in the summary or doing any calculation with then (like now + 3 months ahead) 

Cause one task will have a due date per month based on the number 

Like 8 months - 12, depends .... 

Do you have any magic to share with me?

 

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.
July 25, 2024

Well, done; making progress!

 

Regarding using the number, do you mean of the counter for looping?  If so, I updated that technique later to do so, as described in this post:

https://community.atlassian.com/t5/Automation-articles/Branching-over-smart-values-in-Jira-Automation/ba-p/1741935#M546

And remember such branching occurs in parallel; that means the issues will be created in a random order, not in the sequence of the counter.

0 votes
Valerie Knapp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 25, 2024

Hi @Patricia Francezi , thanks for your question. I am doing something similar for a JSM project.

image.png

The Request Type is for a new employee onboarding. Then, I am branching on the smart value of the custom field, which in this case is a tick box custom field. So, when they indicate in the onboarding ticket that they need a number of items for the new resource, I am creating a sub-task for each one.

Basically, I think the branch is the key but if you share your rule, as @Shawn Doyle - ReleaseTEAM suggests, we can take a closer look.

Good luck!

Patricia Francezi
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 25, 2024

@Valerie Knapp Thanks to jump in - my post was updated. I saw no difference from the posts I used to build it. 

0 votes
Shawn Doyle - ReleaseTEAM
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 25, 2024

Could you post your automation here?  That way we can troubleshoot what is missing.

Patricia Francezi
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 25, 2024

Its updated, please check

Shawn Doyle - ReleaseTEAM
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 25, 2024

so, looks like it enters the branch, however does not loop.

Can you post the value of the field you are using as the loop var?

Also, please paste the full string you have in the Create Variable boxes, the second one is truncated.

My thought is either the field isn't been seen as multiple values or the way you are parsing the field isn't creating multiple values.

Patricia Francezi
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 25, 2024

{{varLoopValues.rightPad(varLoopValues.length.plus(issue."Teste automacao"), "X").remove("NULL").replaceAll("X","X,").substringBeforeLast(",")}}

 

Can you post the value of the field you are using as the loop var?

Teste automacao - in the right of the screen shot 

image.png

Shawn Doyle - ReleaseTEAM
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 25, 2024

Looks like Bill found the issue with the different variable names with the lower vs uppercase L.  

 

Patricia Francezi
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 25, 2024

it was also the "smart value" - it was not working. so I changed to customfield id. 

Anyway THANKS TO JUMP IN!!!!

 

I want also contribution on this if possible

If I want to add the numbers in the summary or doing any calculation with then (like now + 3 months ahead) 

Cause one task will have a due date per month based on the number 

Like 8 months - 12, depends .... 

Suggest an answer

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

Atlassian Community Events