How do I make multiple webhook calls with various information from one custom field in Jira?

Hais, Pedro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 4, 2025

 

I have a field in Jira whose content varies; sometimes there are 5 sets of characters, sometimes 4, and sometimes just 1. The point is that I need the automation to make a request for each set that is contained, and they are separated by commas.

1 answer

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 4, 2025

Hello @Hais, Pedro 

Welcome to the Atlassian community.

If it is a text field you can use an Advanced Branch option like the one I described in my answer here

https://community.atlassian.com/t5/Jira-questions/Example-email-for-email-to-case/qaq-p/2935496#

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.
February 5, 2025

Hi @Hais, Pedro -- Welcome to the Atlassian Community!

Adding to Trudy's suggestion...

 

Are you using Jira Cloud or Jira Server / Data Center?  The Advanced Branch feature is only available for Jira Cloud.  Here is the suggestion to add that for Server / Data Center: https://jira.atlassian.com/browse/JIRAAUTOSERVER-749

 

How do you want to use the results of the different endpoint calls?  Specifically, are they:

  1. each independent, performing some action which does not impact the remainder of the automation rule steps,
  2. after all of the calls complete, the rule will do something with the results,
  3. or something else?

For #1 with independent calls, Trudy's suggestion to use an Advanced Branch will help.

For #2, that is not possible with one rule.  The reason is branching over multiple things is done in parallel and asynchronously, with no guaranteed processing order or even when the branch will complete.  That is, the steps shown in the rule after the branch may start before the branch completes.  

If your scenario is #2 or #3, please explain the problem you are trying to solve.  That is, "why do this?"  This will provide context for the community to offer more suggestions.

 

Kind regards,
Bill

Like Trudy Claspill likes this
Hais, Pedro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 5, 2025

Thanks for welcome, by the way, I'm Brazilian

I tried using the Advanced Branch, but it wasn’t working as expected, as shown in the screenshots.

The {{issue.customfield_10131}} field contains the values "19897317751, 19722939565, 19786147933".

I attempted to call the smart value within the Advanced Branch, but it still remains blank.

and after the calls, as it would be the end of the automation.

 

print3.pngprint2.pngprint1.png

 

 

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 2025

If you want to execute the branch steps for each value in customfield_10131 you need to use the split function in the Advanced Branch step.

{{issue.customfield_10131.split(",")}}

 

Like Bill Sheboy likes this
Hais, Pedro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 5, 2025

i've just tried this way, and still a blank space in URLprint5.pngprint4.png

Hais, Pedro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 5, 2025

The field print6.png

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.
February 5, 2025

Please note well: is the delimiter between the values only a comma or a comma-and-a-space?

If it is a comma-and-space, change the split function to match: split(", ")

 

Hais, Pedro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 5, 2025

It’s a comma followed by a space, and I had tried this before I started this post too.

 

print9.pngprint8.pngprint7.png

Hais, Pedro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 5, 2025

the "{{idhubs}}" always comes blank

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.
February 5, 2025

Inside of the branch, please write the value of the variable to the audit log using the Log action like this:

idhubs value: >>{{idhubs}}<< 

This will confirm what the branch variable contains for each loop.

Then test your rule and post an image showing the audit log details for the rule execution.

Hais, Pedro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 5, 2025

Seems like the test doesn't work on "validate" thing  but in fact when i tried in a real case just worked LOLprint10.png

Like Bill Sheboy likes this
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 2025

Hello @Hais, Pedro 

If I understand your last reply, the automation is working correctly. Is that correct?

If so, please consider clicking on the Accept Answer button above the response thread to mark your Question as Solved. I also encourage you to hover over Bill Sheboy's name in any of his response and click on the Give Kudos button.

Screenshot 2025-02-05 at 3.35.51 PM.png

 

 

The Validate feature would not work for your case because it will only replace smart values that start with {{issue with the actual data from the issue you specify. Since the ticket ID in the URL is not coming directly from the issue, it can't be replaced during the Validate function.

Hais, Pedro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 5, 2025

Thanks for the explanation. I will validate it tomorrow and take care of these things, okay? It seems to work, but I will validate it during a full workday.

Hais, Pedro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 6, 2025

I have one more question about Advanced Branchs, can i extract the value before the next ")"? I have tried this on first print but don't work. I have to extract this value any times on this description. I tested the "substringAfter" work well but the second part noprint12.pngprint11.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2025

Hello @Hais, Pedro 

I'm not sure if I understand your question. Are you saying there could me multiple instances of the following in the Description field?

(Ticket ID: #, #, #)

Or are you saying that you need to extract just once the data between (Ticket ID: and a closing )?

If the latter then try substringBetween()

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#substringBetween-String-open--String-close-

{{issue.Description.substringBetween("Ticket: ", ")").split(",")}}

I have not tested that for myself. There might be a trick to indicating that a parenthesis is the ending character since parentheses are used in the command.

Hais, Pedro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 7, 2025

Its more like that, with any casesprint13.png

Hais, Pedro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 7, 2025

and i just need the ID

Hais, Pedro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 7, 2025

Work but just catch the first one, is there any way to catch any cases?print15.pngprint14.png

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.
February 7, 2025

Please show the expression you are using to extract the ID values and an image of the action where it is used.

Hais, Pedro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 7, 2025

oh sorry print17.pngprint16.png

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.
February 7, 2025

Thank you, and I see substringBetween() is only performing one single find.  To parse out all possible values, the Description needs to be split into lines to search each one.

For example:

{{issue.description.split("\n").substringBetween("Ticket ID: ", ")")}}

 

Update: if you are using Jira Cloud and the Description contains JSON, there is a newer function which makes this kind of parsing much easier: jsonStringToObject()

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#jsonStringToObject--

You would need to review the schema to determine how to extract the fields needed.

Like Trudy Claspill likes this
Hais, Pedro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 7, 2025

The First one have worked, thank you very much! About Jira Cloud how i now im using Jira Cloud?print18.png

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.
February 7, 2025

Awesome; I am glad to learn that helped!

 

If your Jira URL ends in atlassian.net or atlassian.com you are on Jira Cloud.

Otherwise it will likely end with your company's name for Data Center.

Like Hais, Pedro likes this
Hais, Pedro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 10, 2025

Thanks again for your help! Wishing you all a great day!

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events