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.
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#
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:
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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(",")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i've just tried this way, and still a blank space in URL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The field
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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(", ")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It’s a comma followed by a space, and I had tried this before I started this post too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the "{{idhubs}}" always comes blank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Seems like the test doesn't work on "validate" thing but in fact when i tried in a real case just worked LOL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 no
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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()
{{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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Its more like that, with any cases
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
and i just need the ID
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Work but just catch the first one, is there any way to catch any cases?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please show the expression you are using to extract the ID values and an image of the action where it is used.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
oh sorry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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()
You would need to review the schema to determine how to extract the fields needed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The First one have worked, thank you very much! About Jira Cloud how i now im using Jira Cloud?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks again for your help! Wishing you all a great day!
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.