Action - ✏️ Overwrite a Jira custom field with a Projectrak field value

Action - ✏️ Overwrite a Jira custom field 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: Setup - βš™οΈ Create a Projectrak authorization

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: Setup - βš™οΈ Create a Projectrak authorization

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}}