Hi Community,
I'm using "Automation for Jira" to update an issue by removing the first line of text from the issue description. I added JQL when it matches it runs and edit the issue. It is working fine.
Now I'm trying to modify the job to remove the last line of text from the issue description as well and added both pieces of code to update the Action (description) but it's removing the entire issue description when it edits the issue. I tried to add both lines of text in the same code and separated using a comma, still didn't work. This is how issue description looks like an issue is created:
This is the first line.
there
are
more
than
twenty
lines
in
the
issue
description
This is the last line.
{{issue.description.remove("This is the first line that should be remove from the issue.")}}
{{issue.description.remove("This is the last line that should be remove from the issue.")}}
Is this possible to remove the first and last line of the text from an issue?
Thank you,
Hi @Shah Baloch
Are the first and last lines static text? If so, you can remove both with a single expression, eliminating the need for two edit actions and the re-fetch, like this:
{{issue.description.remove("This is the first line that should be removed from the issue.").remove("This is the last line that should be removed from the issue.")}}
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For me it is working that way:
1. Edit description {{issue.description.remove("This is the first line.")}}
2. Refetch data
3. Edit description once again {{issue.description.remove("This is the last line.")}}
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, @Arkadiusz Inglot thank you for your response. Earlier I mentioned it's removing the description. I'm not sure why I earlier said it's removing the description. I might mix it up with something else. Actually, it's not removing the entire description, instead, it's duplicating the description if I add the smart value code twice in the description. I also tried to follow your screenshot. I added an action (desc) and added one smart value to remove the first line, then added re-fetch issue data, and after that added another action (description) and added a smart value for the last line.
When it runs it removes the first line from the description but it won't remove the last line then it adds the entire description below and second part it removes the last line. Here is an example of what it does when it runs.:
there
are
more
than
twenty
lines
in
the
issue
description
This is the last line.
This is the first line.
there
are
more
than
twenty
lines
in
the
issue
description
Thank you,
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.