Projectrak as action - Overwrite a Jira Custom field value with a Projectrak field value

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 a work item is created, if a Projectrak field value is populated, a Jira custom field in that work item should also be populated. 

00. 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 (work item)" in Jira. (Please, keep in mind that the field "Country (work item)" is only an example)

 

01. Create an automation rule

Step 1.  Configure trigger

Create a new trigger →  Work item created



Step 2. Get value from the Project field "Country (project)"

Add component → New condition → Work item fields condition 

 

Step 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.

 

Step 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

 

Step 6. Compare work item value with project value

Add component → New condition → Advanced compare condition

  • First value: {{webhookResponse.body.value.formatted}}

  • Condition: does not equal

  • Second value: Empty

 

Step 7. Update the work item with the Projetrak value

Add component → New action → Edit work item

  • Choose fields to set: Country (work item)

  • Value: {{webhookResponse.body.value.formatted}}

 

Rule 2:  Update work items with Projectrak value every day

Step 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 work item in the query

 

Step 2. Check Country (work item) field is not empty 

Add component → New condition → Work item fields condition 

 

Step 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

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.

 

Step 4. 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 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

 

Step 5. Compare work item value with project value

Add component → New Condition → Advanced compare condition

  • First value: {{webhookResponse.body.value.formatted}}

  • Condition: does not equal

  • Second value: Empty

 

Step 6. Update the work item with the Projetrak value

Add component → New Action → Edit work item

  • Choose fields to set: Country (work item)

  • Value: {{webhookResponse.body.value.formatted}}