Hi,
i've got a little problem using smartvalues in my jira automation webhook.
I'm using
{{webhookResponse.body.additionalInformation.fields.first}}
and receive
{id=33, type=TEXT, values=[21077]}, {id=39, type=TEXT, values=[PG-FBL]}
I'm able to get the values with
{{webhookResponse.body.additionalInformation.fields.first.values.get(0).jsonEncode}}
{{webhookResponse.body.additionalInformation.fields.first.values.get(1).jsonEncode}}
and receive
21077
PG-FBL
Now iam creating a new Issue where those values are matched to some customfields.
The Problem is, sometimes the foreign system where i get the data from, responds with more then those 2 values and in a different order, so i cant match them right.
Is there any possibility to search for the id (id=33 and (id=39) and only get the value back?
Best regards
Martin
Hi, Martin,
One alternative would be to venture into regex matching with the match() function.
See the example from this page:
Let me know if that doesn't make sense but the idea would be to match to different regex using the ID as an anchor.
{{webhookResponse.body.additionalInformation.fields.first.match("id=33, type=TEXT, values=\[(.*)\]")}}
I can't test it right not, but hopefully that should give you a better idea of what I meant!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Filipi,
it doesnt work. i have a question for testing:
{{webhookResponses.get(1).body.additionalInformation.fields.first.match(".*(\d).*")}}
This should give ma a digit back, right? This doesnt work as well. The log is empty for your command and in my test as well.
{{webhookResponses.get(1).body.additionalInformation.fields.first}}
returns
{id=33, type=TEXT, values=[21077]}, {id=39, type=TEXT, values=[PG-OBL]}
I even tried this
{{webhookResponses.get(1).body.additionalInformation.fields.first.get(0).match(".*(\d).*")}}
log still emtpy.
{{webhookResponses.get(1).body.additionalInformation.fields.first.get(0)}}
returns
{id=33, type=TEXT, values=[21077]}
Maybe you have another idea? Would appreciate it.
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.