Projectrak as action - Overwrite a Jira Custom field value with a Projectrak field value
Required
To perform this use case, you need to have technical knowledge. If you need any kind of help, you can contact us through help@deiser.com
Rule 1: Whenever an issue is created, if a Projectrak field value is populated, a Jira custom field in that issue should also be populated.
Previous steps
1. Create a single selection list field called "Country (project)" in Projectrak. (Please, keep in mind that the field "Country (project)" is only an example)
2. Create a single selection list field called "Country (issue)" in Jira. (Please, keep in mind that the field "Country (issue)" is only an example)
Create an automation rule
1. Configure trigger
Create a new trigger → Issue created
2. Get value from the Project field "Country (project)"
Add component → New condition → Issue fields condition
4. Get the authorization token
Add the steps “Get the Projectrak JWT” and then “Store the JWT in a variable“, described at this link: How to create a Projectrak authorization in Automation for Jira
Important:
If you don’t have already created a Projectrak API token , you have to do so as described in the first steps of the above link. If you have already got it, you can reuse it.
5. Get value from the Project field "Country (project)"
Add component → New action → Send a web request
For this example, our Country (project) from Projectrak has the ID: 65934
Replace using your own ID
Web request URL: https://profields-cloud.deiser.com/values/projects/{{project.id}}/fields/65934
Headers:
Content-Type: application/json
Authorization: Bearer {{projectrakJwt}} → defined in step 4
HTTP method: GET
Web request body: Empty
Check: Delay execution of subsequent rule actions until we've received a response for this web request
6. Compare issue value with project value
Add component → New condition → Advanced compare condition
First value: {{webhookResponse.body.value.formatted}}
Condition: does not equal
Second value: Empty
7. Update the issue with the Projetrak value
Add component → New action → Edit issue
Choose fields to set: Country (issue)
Value: {{webhookResponse.body.value.formatted}}
Rule 2: Update issues with Projectrak value every day
1. Schedule an execution
Add trigger → New action → Scheduled
Run rule every: 1 Weeks
On: Every weekday
At: 9:00 am
Check: Run a JQL search and execute actions for each issue in the query
2. Check Country (issue) field is not empty
Add component → New condition → Issue fields condition
3. Get the authorization token
Add the steps “Get the Projectrak JWT” and then “Store the JWT in a variable“, described at this link: How to create a Projectrak authorization in Automation for Jira
4. Get value from the Project field "Country (project)"
Add component → New Action → Send a web request
Web request URL: https://profields-cloud.deiser.com/values/projects/{{project.id}}/fields/65934
Headers:
Content-Type: application/json
Authorization: Bearer {{projectrakJwt}} → defined in step 3
HTTP method: GET
Web request body: Empty
Check: Delay execution of subsequent rule actions until we've received a response for this web request
5. Compare issue value with project value
Add component → New Condition → Advanced compare condition
First value: {{webhookResponse.body.value.formatted}}
Condition: does not equal
Second value: Empty
6. Update the issue with the Projetrak value
Add component → New Action → Edit issue
Choose fields to set: Country (issue)
Value: {{webhookResponse.body.value.formatted}}