Hi, I have a scenario where I am making the comment mandatory while transitioning from status to status and I want to make sure user is also mentioning any link in comment and how can I achieve it.
Thanks.
Hi @Mahanth Prudhvi P , there isn't any means of requiring a user to add a link to a comment. If you need a link consider using a URL custom field and requiring on transition using a Validator.
Hi @Jack Brickey ,
Thanks for your response. I guess may be we can check if the user has mentioned any link in the comment using the automation. Is that possible?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could likely inspect for URL in the last comment following the transition (trigger) and if none found the email the user or even revert the transition if desired. But this is after the fact. Again if this URL is a requirement then I would use a custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jack Brickey Thank you
I am attaching the current configuration which I am currently using. Is there any better approach that you wanna share
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First, add a new screen in Jira without adding any fields to it, as the comment field will be added by default.
Next, include the newly added screen in the workflow transition screen. Then, navigate to the Validators section in the workflow and choose Field Required validator. Within this validator, select Comment as the required field for transition and provide an error message.
Finally, publish the workflow so that it functions as expected.
Now, if you want to capture a URL, you can use any existing custom field of type URL or create a new one and add that to the screen you created and also add a validator to make it mandatory. For example, I have created a transition screen below while transitioning from To Do to In progress and it does not let me transition unless I provide the input.
Refer this post for reference.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
@Kishan Sharma Thanks for the response.
I am actually using everything as you mentioned above but instead of going with extra field(for URL) I would like to know if there is any possibility to check if the user has mentioned any link in the comment section.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using Jira Expression Validator, you can write following expression:
let lastCommentIndex = issue.comments.length -1;
issue.comments[lastCommentIndex].body.plainText.includes('https')
or even using regex for urls
let lastCommentIndex = issue.comments.length -1;
let linkReqex = 'https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)';
issue.comments[lastCommentIndex].body.plainText.match(linkReqex) != null
There are several apps available on the marketplace, which you can use.
We've developed the Jira Expression Validator as part of the free Workflow Building Blocks for Jira app. I would appreciate it if you could give it a try.
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.