Hello all,
Using automation, I'm trying to get the ID of a specific comment to delete it.
So what I want is:
Where I am is:
I am stuck here. I can't seem to get the comment ID. I am using the following smart value.
{{#comments}}{{#body.startsWith("text"){{id}}{{/}}{{/}}
This smart value does work. It works when the comments starts literally with text. However, I want to use a smart value instead of "text", but it doesn't work and I get an error message. So it would look like this.
{{#comments}}{{#body.startsWith({{triggerIssue.key}}){{id}}{{/}}{{/}}
I have tried variations but I only get error messages in the log.
Hi, I was trying to get the id created by an own automation because if the user fix the erros the comments should not be there anymore.
So to capture the commentId, I stored it in a automation Variable using:
{{#issue.comments}}{{#if(exists(body.match(".*(YOUR TEXT).*")))}}{{id}}{{/}}{{/}}
This will retrieve the id of the comment which has YOUR TEXT
Hi Peng Zhou, why are you adding a comment to Issue B when Issue A is closed, if you're just going to delete the comment anyways? Wouldn't it be simpler to just not create the comment in the first place?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.