Jira Automation schedule with custom field

venkatakrishanan r November 29, 2021

Hi All,

My use case:

1, Jira has to trigger a custom comment on schedule date & Time ( I mean not like a cron Job) it has to run once when I schedule to my required time.

I have Jira software cloud & Jenkins on AWS & Integrated works fine if we comment in jira issue with custom comment Jenkins job trigger successfully.

2, Created a custom filed for Schedule and associated with project 

3, I created a Jira Automation to trigger a comment in schedule date & time ( No luck )

Basically I want to understand is Jira Automation will work on schedule time 

Thanks

1 answer

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 29, 2021

Hi @venkatakrishanan r 

Please take a look at the scheduled trigger documentation to learn if it will provide what you need: https://support.atlassian.com/jira-software-cloud/docs/automation-triggers/#Automationtriggers-Scheduled

Kind regards,
Bill

venkatakrishanan r November 30, 2021

Thanks @Bill Sheboy 

I understand that Scheduled will work like cron job but my required is when I update in the date & Time comment has to trigger and update in issue 


My ask is simple,  I have added a custom variable name in Jira issue "Scheduled Date and Time"  and I have to comment some custom message in issue 

I creating a new issue, My custom message has to trigger once I update the date & time in "Scheduled Date and Time" 

Is this possible in Jira automation 

The below screen shot represent that my new comment "{{Complete the build}}" should trigger only when I update the filed  "Scheduled Date and Time" 

Automation workflow:

1, Issue commented "Comment Type ( Comment is the main action)"

2,

issue_field.PNG 

3,

Jira-rule.PNG

4, comment.PNG

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 30, 2021

Thanks for that information, and I am still confused by what your trigger is:

You describe wanting to trigger on a change to your custom field ("Scheduled Date and Time") and then show a trigger apparently on the comment being added. 

Which do you want to do?

If you want what you show in the rule image, your condition would need to *exactly* match the execution time in order to work.  That may not be possible and instead you might need to perform a date comparison with diff() to see if the delta-time is within an acceptable threshold.

venkatakrishanan r November 30, 2021

@Bill Sheboy 

Thanks, Let me explain what iam trying to achieve.

1, I need to trigger a Jenkins job from Jira comment updated

2, So once new issue created will update the customer field ("Scheduled Date and Time") the comment should added in Jira issue as declared in automation rule  hence Jenkins job will trigger as per ("Scheduled Date and Time")

Let me know the possibilities or advice what rule need to set in Jira or any other way to schedule Jenkins job on our required time 

 
Thanks 

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 1, 2021

From what you describe as your steps...

  1. An issue is created manually
  2. The custom field "Scheduled Date and Time" is set on the issue manually
  3. A comment is added to the issue manually
  4. An automation rule detects the adding of the comment, checks some conditions, and then schedules a Jenkins job

Is that correct?

If so, how are you scheduling the Jenkins job: manually, with the REST API / outgoing webrequest, etc.?  

venkatakrishanan r December 2, 2021

Hi @Bill Sheboy 

3, A comment is added to the issue manually

        You might have noticed in 4th screen shot in automation steps Edit Comment ({{Complete the build}}) - Automation has to trigger the comment based on 2nd screen shot  "Scheduled Date and Time" 

Through webhook, once comment added in issue, Jenkins job has to trigger

 

Thanks

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 2, 2021

Thanks for that information.  I believe your rule should then work as you expect.  The only part to decide is using the custom field in your webhook to schedule the Jenkins job.  Please see this information for formatting date/time fields:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events