Trigger recipes with Automation
The need: trigger an issue copy when there's a comment, the SLA is breached, field updated etc
Automation for Jira is a great tool that allows project admins to create many rules and trigger many actions.
The solution: use the public REST API to trigger recipes with Automation
Thanks to Elements Copy & Sync public REST API, it is possible to benefit from the whole list of Automation rule conditions to trigger recipes. Creating issue copies has never been easier, be it when a comment is posted, or a field updated, or any other of the many triggers available in Automation.
Tutorial
In this example, we will copy an issue automatically when a comment is posted in it.
This guide explains how a Copy & Sync recipe titled "Escalate ticket" can be triggered by Automation to copy any issue where a comment is posted.
Prerequisites
A recipe called "Escalate ticket" has been created, activated, and is available on the Jira instance.
This recipe must target only one project and one issue type.
When a recipe is triggered with an API call, the copy is performed without any input from the user. This means no issue creation screen is displayed during the transition.
For this reason, recipes that are meant to be triggered during transition must only target one project and one issue type, because the user is not able to select these options during the transition (except if they use the value from a custom field).
Configuration steps
1 - As a Jira administrator, go to the "Elements Copy & Sync Cloud" administration and click on Settings in the navigation bar.
2 - In the "Authentication" section, click on the Create API token button.
By doing so, an authentification token is generated that will allow you to call the Copy & Sync API.
3 - Click on the Copy to clipboard button to save the token, and copy it somewhere safe.
4 - In the Actor select list, choose the Jira user that will be used to trigger the recipes via the API.
This actor is mandatory, as their permissions will be used by Jira to decide whether actions done through the API calls are authorized or not.
5 - Click on Recipes in the navigation bar
6 - In the Recipes listing page, select "Escalate ticket" in the Active Recipes list.
7 - In the Recipe configuration page, click on the Triggers tab.
8 - In the Public API section, click on the Copy to clipboard option to copy the Request URL that will be used in the API call.
At this point, you have all the information you require to make calls to the Copy & Sync API and to start copying issues with this recipe.
In the following steps, we will show you how to configure Automation for Jira to trigger this recipe.
9 - Open Automation on your Jira instance.
10 - Click on the Create a rule button.
11 - In the New trigger page, select the Issue commented trigger.
Note : This is just for this example, you can use any trigger you want.
12 - In the next screen, click on the Save button to save the trigger.
13 - In the Add component page, select New action.
14 - In the New action page, select Send web request.
15 - In the Send web request page, two fields need to be configured:
First, put the Request URL copied at step 8 in the Web request URL field
Then, in the Headers option, add the parameter "token" and put the token created at step 3 as its value.
Note: at the end of the Request URL, the placeholder {{issue.key}} means that the current issue will be copied by the recipe. This placeholder can be replaced by any issue key if you wish to copy a specific issue.
16 - Click on the Save button.
17 - In the following screen, add a name to your Automation rule and click on the Turn it on button.
And you're done!
Result
With this configuration, each time a comment is posted in an issue, this issue will be automatically copied by the "Escalate ticket" recipe.
As you may have guessed, this is not a very realistic use case, so don't hesitate to make it your own by selecting the Automation trigger you find the most valuable to your use cases.
•••
New to Elements Copy & Sync?
If this tutorial has stirred your imagination, why not give it a try?
• Try Elements Copy & Sync for free •