I have created a rule, when I close ticket rule checks if Comment section contain any http,https, confluence, jira, or SharePoint link in ticket, If it does then ticket should remain in closed status or if this condition doesn’t match then ticket should be in push back to backlog status.
I don’t know why, even I attached confluence link in comment and close the ticket the rule runs and it push back ticket to backlog instead of closed status.
Is there something I’m doing wrong?
Hi @Bhumi Yadav -- Welcome to the Atlassian Community!
The smart value {{issue.comments}} is a list of values, each one with structure including the body, author, etc. of all the comments: https://confluence.atlassian.com/automation/jira-smart-values-issues-993924860.html#Jirasmartvaluesissues-issue.commentsissue.comments
Are you trying to check for the text / links in all possible comments added for the issue, only the last comment, or something else?
Kind regards,
Bill
Yes any links ( for eg if I comment down in ticket:- The task is complete (link) and add any link after it)
then rule should check if there is any link or not in comment section.
dont know I can’t I resolve it, not able to write down smart value for it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could the URLs contain mixed case? If so, perhaps force the comments to lower case before comparison.
Or, perhaps try using the match() function with your regular expression in the first value to evaluate all comments, and then test if any results are found.
{{issue.comments.body.split(" ").toLowercase().match("(https?://.*(confluence|sharepoint)\.com)")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So I have a regex
{{issue.comments.body.match("(http|https)://").size}}
but it didn’t work for short links
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you using Jira Cloud or Server / Data Center? I believe that may impact the format of the link representation.
You can confirm the representation by writing the comment to the audit log to see the format of the smart link. For example, this is what I see for Jira Cloud in a comment:
here is a comment with a URL [https://community.atlassian.com/|https://community.atlassian.com/|smart-link]
And so when I tested your expression:
{{issue.comments.body.match("(http|https)://").size}}
It doubles the count size. Once you have an expression that works, you may want to add the list function distinct at the end to remove duplicates.
As you want this to also work with shortened links, my suggestion is to perform an internet search for example regular expressions to parse URLs, and then update that for your shortened URL syntax. Then test thoroughly.
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.
@Bhumi Yadav Welcome! I think the first condition "does not match" is the responsible for that?
Nicolas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nicolas Grossi It showing IF block condition passed, issue to BACKLOG,
but it should not pass I have confluence link added in comment.
If I have link in comment then transition issue should CLOSED.
Not sure if my Regex is correct or not.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nicolas Grossi
When Issue Transistioned to Closed- Chech IF attachment is Empty or Not - If No- Ticket Remains Closed - IF Yes - Check comment if there is any url link present - No URL (then transition the issue to Backlog) - Yes (Ticket remains Closed)
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.