I have a Select List (single choice) drop down called Risk Impact. The values in it are in the format of a "# - text", e.g. 1 - Trivial
I've tried several ways to obtain the number from the string, however I'm having no luck. These smart values I've tried
Risk Impact: {{issue.Risk Impact}}
1 {{issue.Risk Impact.charAt(1)}}
2 {{issue.Risk Impact.abbreviate(1)}}
3 {{issue.Risk Impact.match("\d")}}
4 {{issue.Risk Impact.split(" ").first}}
5 {{issue.Risk Impact.left(1)}}
6 {{issue.Risk Impact.replaceAll("\D")}}
7 {{issue.Risk Impact.substringBefore(" ")}}
Produces the following output
Risk Impact: 5 - Major
1
2
3
4
5
6
7
I'm sure I've had some of them work before, but this week, no luck. Any suggestions?
could you please try the smart value like below:
{{issue.fields.customfield_12345.value.substring(0, 1)}}
customfield_12345 - custom field id for the drop down field
Regards,
Dilip
Hi @Dilip ,
I tried the customfield option, but got the same (empty) results. I also tried triggerIssue
The fact {{issue.Risk Impact}} works suggests the smartvalue is working, but even using the customfield option the operations aren't.
That said, .value.substring(0, 1) seems to have worked when all the other operations failed, so thank you for that suggestion.
I'm now able to get the outputs I wanted with (or the costomfield option)
{{issue.fields.Risk Likelihood.value.substring(0, 1)}}
{{issue.fields.Risk Impact.value.substring(0, 1)}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It turns out adding .value would also have helped in some cases. These all return the expected output too:
4 {{issue.Risk Impact.value.split(" ").first}}
5 {{issue.Risk Impact.value.left(1)}}
7 {{issue.Risk Impact.value.substringBefore(" ")}}
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.