Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create ticket automatically on basis of custom field value.

kanishka July 13, 2020

Hi 

I want to create a new ticket automatically, after 6 months of "Date of Joining"(Custom field).

Could anyone help me with this.

2 answers

1 accepted

0 votes
Answer accepted
Andrew Laden
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.
July 13, 2020

You could use Automation for Jira to run a query every night searching (using JQL) for issues where Probation Complete Date was 6 months ago AND does not contain a linked issue to whatever new issue type you are making. If it finds any then create the linked issue.

So its not really a "listener". Just looks every night to see if there is anything to do, and then does it. You just want to make sure to have a way to filter out the tickets that have already been acted on.

kanishka July 14, 2020

Hi @Andrew Laden  Could you please elaborate as i am not having much knowledge in automation.

we have only "date of joining" custom field and user will enter this date.

Now after 6 months of "date of joining" new issue has to create.

Andrew Laden
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.
July 14, 2020

Do you have the Automation for Jira Addon?

https://marketplace.atlassian.com/apps/1215460/automation-for-jira-server?hosting=server&tab=overview

You would need the full version to create new issues.

kanishka July 14, 2020

Yes I have Automation jira addon.

kanishka July 16, 2020

@Andrew Laden  In automation, on scheduled trigger we are writing this JQL 

project = TEST AND issuetype in standardIssueTypes() AND "Date of Joining" >= startOfDay(-1d)

 

and "Fixed rate of every" 10 minutes i have given.

but it is not working properly.

Andrew Laden
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.
July 16, 2020

When you say it is not working properly, what is going wrong? 

as a guess, Check the following.

In the Scheduled trigger, just below the JQL field, there is a "Validate Query" link. If you click on that, does it show the issues that you would expect to see? If not, you need to fix your JQL till you get it to show what you would expect.

Also check the "scope" of your automation rule. Under Rule Details, make sure the its either a global rule, or that both the project you are searching and the project you are trying to create the ticket in are listed.

Other then that I would need more detail as to what is not working.

Like kanishka likes this
kanishka July 24, 2020

Thanks @Andrew Laden for response. 

We got the correct JQL.

Andrew Laden
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.
July 24, 2020

Great. Dont forget to mark the answer as accepted

What was your final JQL out of curiosity?

kanishka July 31, 2020

@Andrew Laden 

1. Scheduled everyday with JQL 

Project = Test AND issuetype = "Service Request" AND "Date of Joining" = startOfDay(-165d)

2. Gave condition to check it has linked issue or not.

3. If not, create linked issue.

Like Andrew Laden likes this
0 votes
Ismael Jimoh
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.
July 13, 2020

You can use scriptrunner add-on for this.

  1. Add a create issue post function 
  2. Add a checker to see if the field is populated 
  3. Add a create issue event specifying which project the issue should be created in. See video sample: https://m.youtube.com/watch?v=UT_qche3kc4

Cheers.

kanishka July 13, 2020

Hi @Ismael Jimoh  Thanks a lot for quick reply.

actually I want to create issue automatically after completion of 6 moths from "Date of joining" which is custom fields. (means when probation complete)

 

I tried :

Created scripted field "Probation Complete Date" which will calculate 6 months from "Date of Joining"

Created Listener to create new issue.

 

But when should i call this listener. 

How it will calculate 6 months automatically.

 

Please help me with this.

Like Mahesh Kallepalli likes this
Ismael Jimoh
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.
July 13, 2020

Hi @kanishka 

I’m not sure how your date field would function but of you can use JQL to search for it, you can use the Escalation job to trigger issue creation based on value of your date field.

See a sample here: https://scriptrunner.adaptavist.com/latest/jira/escalation-service.html

Unfortunately, I don’t have a laptop with me to help explain this in more details.

Regards.

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events