How to escape special characters when remotely creating an issue with CLI plugin?

I'm trying to use the CLI Plugin in a post workflow action to remotely create a copy of an issue.

When I pass the original_description and original_summary, it will fail if they contain quotes, and presumably other special characters.

I was hoping the substitution variables would be properly escaped to avoid this, but it doesn't seem that way.

How can I address this?

1 answer

0 votes

Hi Mark,

I would suggest you on using backslash (\) prior to:

  • doube-quotes (") - e.g.: "this is my \"sample\" text"

I would kindly ask you to provide an example to what you are trying to perform, please.

Kind regards,
Rafael

I'm trying to perform a worflow post-action to remotely clone an issue.

I need to populate the summary and description of the newly created issue using those of the current issue. If there are quotes or other special characters, the action fails.

I don't have the opportunity to escape those characters, that I'm aware of, because I'm passing them as a replacement variable to the CLI plugin.

CLI action
Product: JIRA
Action: --action run --common "--project PRJ" --server https://ondemand--user user --password password
Data: -a createIssue --type Bug --summary "%original_summary%" <br>-a setFieldValue --issue @issue@ --field Description --values "%original_description%"<br>-a setFieldValue --issue @issue@ --field "External Bugid" --values "%original_key%"<br>-a addLabels --issue @issue@ --labels %original_key%

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,760 views 11 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot