My requirement is as below. Can you please let me know if that is achievable using JIRA automation?
When a jira issue is updated, I want to apply a label, say XYZ, based on below logic:
Capture the datetime of the second last EVENT, say, DATETIME-SECOND-LAST
AND
Capture the datetime of the last EVENT, say, DATETIME-LAST
EVENT here can be.....
comment added by a user belonging to ABC user group
OR
status changed to TO DO or IN PROGRESS
If the difference of DATETIME-SECOND-LAST and DATETIME-LAST is greater than X hours, then apply the label, XYZ.
Hi @Amit Gandhi
I suspect that theoretically you could do that with an automation rule (with the REST API, or with multiple rules and custom fields), however...
That sounds like a brittle solution: depending on the date/time difference between two unrelated events. Particularly because you have no control over what happens during the time between them (e.g. other issue updates).
Would you please describe the problem you are trying to solve? Knowing that may provide context for the community to offer suggestions. Thanks!
Kind regards,
Bill
Thanks for your response.
We have a requirement as below:
ABC team is responsible to update JIRA ticket every X hours. If they miss this update, then we should apply a label, say LBL1, to the JIRA ticket.
The update they do can be a status change (transition to one of the selected statuses) or a comment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for clarifying!
I would recommend a single rule, on a scheduled trigger running every X-hours. Then use JQL to find any status changes (or lack thereof) and rule conditions to check for the last comment.
Here is an example below, which you should adjust and test the JQL separately to meet your needs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks.
The only confusion I have here is will it take care of OR conditions below?
The update they do can be
a status change (transition to one of the selected statuses)
OR
a comment.
The label should be added if they have not performed EITHER of above actions after X hours passed from last datetime of EITHER of above actions.
Example,
A team is responsible to update jira card every 2 hours.
User1 belongs to this team.
User1 has transitioned to one of the statuses or added a comment at 3 pm
If he/she has not transitioned to one of the statuses AND not added a comment till 5 pm, then the label should be applied.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is no OR clause or condition structure in automation rules at this time.
A work-around would be to use a less restrictive JQL for the trigger, and then test both conditions using if/else structures, such as:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, but seems my requirements do not get addressed with this logic. See below.
User updated status at 12 noon
Rule ran at 12 noon - no label added
User added a comment at 1 pm
User added a comment at 2 pm
Rule ran at 2 pm - label not added
Rule ran at 4 pm - label added as last status change was at 12 noon, but it should not have been as last comment is added at 2 pm
Rule ran at 6 pm - label added
The above is due to status condition executing first. Suppose we remove status condition for time being. Then -
User added a comment at 6:30 pm
Rule ran at 8 pm - label not added
User added a comment at 9 pm
Rule ran at 10 pm - label not added as it sees the last comment added at 9 pm but it missed the earlier part where comment added at 6:30 pm and then 9 pm comment was added after 2.5 hours
User added a comment at 11:45 pm
Rule ran at 12 night - label not added as it sees the last comment added at 11:45 pm but it missed the earlier part where comment added at 9 pm and then 11:45 pm comment was added after 2.75 hours
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What I provided was an example of the structure. You will need to look at all possible combinations to decide what your want the outcome to be, and adjust the rule accordingly, reducing the similar cases.
Off the top of my head, here are some scenarios to decide if a label should/should not be added. Assumption: the issue is not in a "done" status.
Status Comment Add label?
--------------------------- --------------------------- ----------
Never changed after create No comment ever added ???
Changed > 2 hours ago No comment ever added ???
Changed = 2 hours ago No comment ever added ???
Changed < 2 hours ago No comment ever added ???
Never changed after create Comment added > 2 hours ago ???
Changed > 2 hours ago Comment added > 2 hours ago ???
Changed = 2 hours ago Comment added > 2 hours ago ???
Changed < 2 hours ago Comment added > 2 hours ago ???
Never changed after create Comment added = 2 hours ago ???
Changed > 2 hours ago Comment added = 2 hours ago ???
Changed = 2 hours ago Comment added = 2 hours ago ???
Changed < 2 hours ago Comment added = 2 hours ago ???
Never changed after create Comment added < 2 hours ago ???
Changed > 2 hours ago Comment added < 2 hours ago ???
Changed = 2 hours ago Comment added < 2 hours ago ???
Changed < 2 hours ago Comment added < 2 hours ago ???
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for helping on this again.
See below.
Wil check on the JIRA automation rule logic. Any further help would be appreciated to make it optimum and effective.
Status Comment Add label?
--------------------------- --------------------------- ----------
Never changed after create No comment ever added YES
Changed > 2 hours ago No comment ever added YES
Changed = 2 hours ago No comment ever added NO
Changed < 2 hours ago No comment ever added NO
Never changed after create Comment added > 2 hours ago YES
Changed > 2 hours ago Comment added > 2 hours ago YES
Changed = 2 hours ago Comment added > 2 hours ago NO
Changed < 2 hours ago Comment added > 2 hours ago NO
Never changed after create Comment added = 2 hours ago NO
Changed > 2 hours ago Comment added = 2 hours ago NO
Changed = 2 hours ago Comment added = 2 hours ago NO
Changed < 2 hours ago Comment added = 2 hours ago NO
Never changed after create Comment added < 2 hours ago NO
Changed > 2 hours ago Comment added < 2 hours ago NO
Changed = 2 hours ago Comment added < 2 hours ago NO
Changed < 2 hours ago Comment added < 2 hours ago NO
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the additional details, and with the example rule I provided you should be able to create the rule, with these adjustments:
As a reminder, this is a community forum of Atlassian tool users voluntarily helping each other. This is not a free-staffing pool of labor to build solutions for a request. Please try implementing this rule yourself, test it, and if you run into problems the community can help when you show your rule and describe what does not work as you expect. Or you could contact your Jira Site Admin for support in creating a rule to solve the problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks.
Just wanted to check the requirements shared can be fulfilled with JIRA automation.
It seems it is not.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please re-read the responses above; this rule can be implemented as you have described.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let me reiterate/elaborate again.
Lets focus on requirements, not automation logic (I will take care of it).
Issue 1 has 10 comments in which user A belonging to user group B has added comments at position 2,3,5,7.
It should check for the difference in datetime for each of below and apply label if any of that is greater than 2 hours.
datetime of comment 3 creation - datetime of comment 2 creation
datetime of comment 5 creation - datetime of comment 3 creation
datetime of comment 7 creation - datetime of comment 5 creation
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Amit Gandhi
Thanks for the additional details on the use case. I do not believe that would be possible (or easily possible) to implement with out-of-the-box features, including automation rules. It would require more complex conditional and filtering logic than exists today.
More complex work-arounds would be to capture in custom fields when people in that user group add a comment, and then compare to that information with "now", such as with a JQL filter subscription. There may also be marketplace addons to perform this type of monitoring with such needs.
Kind regards,
Bill
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.