There is a custom field called Reported Version and there is a value field under it. Need to split the column by "." character to compare the last part with a constant in an automation function.
Custom field name : "Reported version"
Field structure in Rest API :
"customfield_15753":
{
"self": "some value",
"value": "A.B.0",
"id": "1111"
}
Tested with following. But it does not work as expected.
{{issue.fields.customfield_15753.value.split(".").get(2) = "0"}}
I struggled with the same issue, and decided to share here although it's a quite old post.
It appears that split, replace, left, ... functions do not work for custom fields.
This is the way I managed to make it run: use a smart value variable in between...
Hope this helps someone, and do share better methods that anyone might have.
Thanks and cheers
Hi @José Nogueira ,
It makes no sense that we need to go to such an extent, but your solution works !
I was struggling with the "from" object from the changelog, it felt like it's neither an array (I couldn't loop through its element), nor a string (I couldn't split it to turn it into an array)
But storing it into a variable, ex :
{{changelog.myCustomField.from.remove("[").remove("]")}}
allowed me to save the IDs as a comma-separated string (without the brackets), ex :
1234,1235,1236
on which I could finally get an array with a simple split
myCustomFieldFromVariable.split(",")
I'm just putting the snippets here to help if someone googles it
Thanks a lot José !
And I wish Atlassian could update the documentation to make it clear
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I haven't tried, but you're doing two things in that expression: splitting and getting the 2nd components plus comparing it to a string literal. If I were you, I'd try if the split-and-get works. If it is, then the problem is with the comparison.
For that, I'd try the Advanced Compare Condition component in the rule.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Aron Gombas thank you for the reply. Yes, the problem is that the split function does not works as expected. Do you have any suggestions on that, how to split a string value from a custom field in Jira.
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.