I have 2 projects. When a ticket is raised in project1, a ticket is auto created in project2 and added as a linked item. the project 2 ticket is only created and linked if a specific field has a specific value.
The issue us that project 1 is used for other tickets also and we are nearing our monthly quota for executions.
Ideally, I only want the automation rule to run is a specific field has a specific value. (for some reason I cannot add a screenshot).
The rule starts off with 'When: Issue created' so it runs every time
Any ideas would be appreciated.
Hi @Lance Shaw
From what you described, I suspect you are running this as a global/multi-project scope, rather than a single project scope rule. Is that correct?
If so, you can do what you need with a project scope rule, eliminating the need to use up your rule execution limit for global rules.
For example:
{ "update": {
"issuelinks": [
{
"add": {
"type": {
"name": "Relates"
},
"outwardIssue": {
"key": "{{issue.key}}"
}
}
}
]
}
}
Kind regards,
Bill
Thanks for that Bill. This works without using the execution limit. Struggling with the second part though.
The status of project1 updates and I need to update the status of a linked issue for project 2 to the same status.
I've started it with Issue Transitioned and then use a Branch Rule/related issues object and then a JQL statement of 'project = project2', but as this Rule is in project 1 it does not seem to see project 2. In the audit log, it shows 'No related issues could be found'
any pointers please
Regards Lance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A project-scope rule cannot transition (or make any edits) to issues in another project directly.
You would need to use a global/multi-project scope rule to do so...and that will be impacted by the limits of your Jira Cloud license level. In general, I suspect such a rule would viable for a Premium license, as it can have a lot more global rule runs per month. For other levels you could quickly run out of your limits.
One possible work-around is to have the project-scope rule make the transition by calling the REST API method: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-transitions-post
If you want to try that, here is a how-to article for calling the REST API from a rule: https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Lance Shaw ,
Welcome to the community !!
The automation rule will trigger for every ticket created irrespective of conditions, but it wont create a new ticket until the given condition is met.
We cannot make rule to run when only particular ticket is created.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rilwan
Is there not a conditional trigger or some JQL that would allow this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Lance Shaw
You can try creating new rule as below
Trigger == Issue created
New condition == Issue fields condition, select labels field and the value required.
New Action == Create issue
Please note: The rule will for all tickets created, but linked issue will be created only when the condition given is met.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rilwan
Will that not still run every time an issue is created?
I'm looking at using a schedule trigger to run maybe every 2 hours and then proceed with creating a new ticket if the condition of the schedule is true.
So we can have up to 100 tickets a day created and at present, that will run the rule 100 times. If we have a schedule for every 2 hours then this will only be 12 times.
Our monthly execution is set to 500 so just this one rule could exceed that value in a week as it's currently set
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Lance Shaw
1. Will that not still run every time an issue is created?
-- Yes, it will run. But it will not impact anything unless you have 100s ticket created in very short time like 1-5 minutes.
2. You can. Use Scheduled trigger and JQL can be
created >= -2h and labels = 'sample-space'. Modify the JQL as required for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lance,
Could you try using the trigger "field value changed"?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tara
The issue is the field holds the value when the ticket is created.
Also the field in question is called label and a label is added at various parts of the tickets life so each time a label is added, then the rule will still run
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.