Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,462,673
Community Members
 
Community Events
176
Community Groups

Automation To Remove String From Description

Hello Community,

On my service desk project there's a 3rd party integration that appends text to the description field that I'd like to remove as it causes unnecessary noise and confusion. The process is a ticket is created where reporter fills in their own description and the text is added after creation so the reporter is unaware. Upon create, I'd like automation to remove that added text and maintain only what the reporter wrote.

For this example I'd like to remove the word "Please remove this text" when summary includes Test.

I've made several attempts, trying both "fields" and "update" with the format differing slightly for update. My understanding though, is if using "fields" - it behaves as a set and will entirely override the field.

"fields": and "update":

My latest attempt; realizing format is off for a few likely reasons. I was under the impression I could utilize the smart values to remove or replace text, but maintain the description otherwise.

{
"update": {
"description": [
{
"set": "{{issue.description.remove.asJsonString("Please remove this text")}}"
}
]
}
}

Hoping someone could help me identify the correct way to do this. Also, would I need to select the field "description" or can I go right to 'advanced' section? 

 

 

Screenshot 2020-09-25 171358.png

 

Thanks.

3 answers

1 accepted

2 votes
Answer accepted
Hana Kučerová Community Leader Sep 27, 2020

Hi,

please try something like this. I've just tested it and it works for me.

 

rule.png

Hi @Hana Kučerová,

I have created a CustomField "Latest Comment" and intend to capture first few characters of the Issue comment in this CustomField.

Can you review the attached image and share the syntax / smartvalue for this?

PS: Thanks @Hana Kučerová, I configured {{comment.body.abbreviate(int MaxLength)}}

Thanks and regards,

Ashraf BSmartValue.png

If someone else is looking for a way to delete something from the description that is always changing: 

  1. Define some characters that are always around that part you want deleted
  2. Choose Edit issue -> description
  3. Fill in this code into the description field like @Hana Kučerová stated and insert your predefined characters:
{{issue.description.remove(issue.description.substringBetween("beginning_characters","ending_characters"))}}

 Done.

That was a simple fix, thanks.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events