Hi,
I'm trying to extract a rich text formatted URL to input into a URL field using smart values. Is there a way to do this?
The input is something like this:
[https://community.atlassian.com/t5/forums/postpage/choose-node/true/interaction-style/qanda | https://community.atlassian.com/t5/forums/postpage/choose-node/true/interaction-style/qanda]
I'd like the output of:
https://community.atlassian.com/t5/forums/postpage/choose-node/true/interaction-style/qanda
I've tried splits, substring, encode, none of them have worked. Any ideas?
Hi @Ahmad Sidawi
For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected. Those will provide context for the community to offer ideas. Thanks!
Until we see those...
Several of text functions, including match() with a regular expression, should work for this. The specifics will depend upon what your example input looks like, how many URL you expect in the field, etc.
One expression, based one what you show and assuming only one URL, could be:
{{issue.yourField.substringBetween("[","]").split("|").get(1).trim()}}
Kind regards,Bill
Hi Bill,
This automation gets data across instances which is formatted differently in the first instance.
The point of failure is trying to create the variable and update the 'Link to Test Report' field (URL field). Other fields are OK.
Tried your suggestion, its returning just the 'h' from all the characters:
Thanks,
Ahmad
What I suggested was based on what you showed, assuming it was from the plain text. It appears what you showed in the question does not reflect the plain text representation of the markup in the field.
I suggest writing the field to the audit log by itself, run the rule, review the log, and that will clarify which functions are needed to parse the URL.
Better still: find an example issue with your field and call the REST API get issue function with a browser tab and view directly what the field contains: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
For example, here is the markup guide, and I suspect it is the link formats, and so get(1) should be used instead after the split: https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all
It looks like you're new here. Sign in or register to get started.