I am trying to use a smart variable in the following way:
{{priorities.split(":").get(ppValue.asNumber)}}
priorities are created as a list proceeding this action, are are "Highest:High:Medium:Low:Lowest" . ppValue is set to 1 earlier in the automation.
When I run, there is no value returned.
When I reformat as the following:
{{priorities.split(":").get(1)}}
it returns "High" as expected.
Any thoughts on how to format this so the dynamic value can be passed in?
Thank you
I was unable to get the split to return a result.
My final solution (included in a Create Variable smart action) was
{{#if(equals(ppValue,"1"))}}Highest{{/}}{{#if(equals(ppValue,"2"))}}High{{/}}{{#if(equals(ppValue,"3"))}}Medium{{/}}{{#if(equals(ppValue,"4"))}}Low{{/}}{{#if(equals(ppValue,"5"))}}Lowest{{/}}
Thanks for the feedback and help
I am glad you got it to work, even if the get() after the split did not work.
I had an error in my post, as after split() the list is 0-based, not 1-based, so I will update that for anyone else who reads this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ken Young
In my experience, several of the functions in automation rules cannot take a created variable or smart value as a parameter. I recall hitting this exact same symptom trying to solve another problem and found get() had this behavior/limitation. Same symptom with smart value, list filtering.
The only work-around I found was to use a series of adjacent, conditional logic expressions...with the intent that one-and-only-one would evaluate to true. This seemed to break the chain of smart value parsing which caused a null somewhere.
Perhaps try this:
{{#if(equals(ppValue,1)}}{{priorities.split(":").get(1)}}{{/}}{{#if(equals(ppValue,2)}}{{priorities.split(":").get(2)}}{{/}}{{#if(equals(ppValue,3)}}{{priorities.split(":").get(3)}}{{/}}{{#if(equals(ppValue,4)}}{{priorities.split(":").get(4)}}{{/}}{{#if(equals(ppValue,5)}}{{priorities.split(":").get(5)}}{{/}}
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.
Thank you @Bill Sheboy for the suggestion. I tried the code in a create variable action, but unfortunately is set a null action. I will, however, try it in "additional fields" when I am trying to create or updated an issue to see if I get a different result.
If it worked in the create variable, this could be a really powerful way to extend automation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ooops, my bad; missing closing parentheses as I wrote that from memory. Here is the fixed one:
{{#if(equals(ppValue,1))}}{{priorities.split(":").get(0)}}{{/}}{{#if(equals(ppValue,2))}}{{priorities.split(":").get(1)}}{{/}}{{#if(equals(ppValue,3))}}{{priorities.split(":").get(2)}}{{/}}{{#if(equals(ppValue,4))}}{{priorities.split(":").get(3)}}{{/}}{{#if(equals(ppValue,5))}}{{priorities.split(":").get(4)}}{{/}}
UPDATED: after the split() the list is 0-based and not 1-based.
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 feedback and help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ken Young
What is it you are trying to achieve with this rule?
Perhaps if we could see all of the workings it would make it easier for us to assist.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Curt Holley . I have an external system that is passing in information via email (formatted subject line) to Jira. Priority can be P1, P2, P3, P4, P5, I am trying to convert to Jira's priorities aka: "Highest:High:Medium:Low:Lowest". In this manner, I can set the priority of the created ticket to the correct priority using the "additional fields" in the edit issue action.
My other option is possibly to us the ID, but I am trying to determine if this mapping could be done,
Thx
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.