Hello,
I am trying to setup a new rule using Automation for Jira where for any text that matches certain strings, it'll replace this with another text in the comments section:
1) This is my rule and I validated the regex at regex101.com successfully:

2) It then edits the comment field and replaces anything that contains "Nm" : "text" with "":
Edit Issue:
{
"update": {
{{issue.comments.last.body.replace("\Nm": "([^"]+)\", "")}}
}
}
However my rule is failing with the following message:
Edit Issue:
Error while rendering additional fields.Failed to get value for issue.comments.last.body.replace("\Nm": "([^"]+)\", "")
I've added a Log Action to my rule and it captures the comment successfully:
Issue comment is: {{issue.comments.last.body}}
Log Action:
LogIssue comment is: {{"PstlAdr": { "Ctry": "BRA", "AdrLine": "Avenida a",dafasdf "TwnNm": "Coa",sdfasdf "CtrySubDvsn": "RadsfadsfasdfO", "PstCd": "00000" }, "CtctDtls": { "Nm": "OaA", "PhneNb": "asdfasdfadsf" } }, "PmtId": { "InstrId": "adsfadsf" }, "PmtTpInf": { "CtgyPurp": { "Prtry": "B" } }, "Purp": { "Prtry": "" }"created_at": "2020-08-06T16:30:25.21Z"}}}
Not sure what the issue could be as the regex matches the correct expression in the comments section.
Any ideas on how to fix this?
Thanks!