Projectrak as action - Create a project and fill Projectrak with issue data after issue transition
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
It is not necessary to create a Project, just avoid the second step of the automation rule
Create an automation rule
1. Configure trigger
Create a new trigger → When issue transitioned
2. Create a project
Generate a base64 authentication for the Jira user
Generate a string in base64 with the text "<JIRA_USER>:<JIRA_API_TOKEN>"
1. Use the terminal:
echo -n YOUR_JIRA_USER:YOUR_JIRA_API_TOKEN | base64
2. Store the result (something like this):
Configure action
Add component → New action → Send web request
Web request URL: https://YOUR_INSTANCE.atlassian.net/rest/api/3/project
Headers:
Content-Type: application/json
Authorization: Basic c2VydmljZXRlYW2AZGVpc2VyLmNvbTpBTGN1bkwzNzQ1YTRBUFY3cXcwZkU3MkQ=-EXAMPLE (The Authentication in Base64)
HTTP method: POST
Web request body: Custom data
Custom data (ℹ️ Replace DUMMYAUTO for your project key)
{ "key": "DUMMYAUTO", "name": "Test dummy project autogenerated", "description": "Description for Test dummy project autogenerated", "leadAccountId": "{{issue.reporter.accountId}}", "url": "https://www.deiser.com", "assigneeType": "UNASSIGNED", "projectTemplateKey": "com.atlassian.jira-core-project-templates:jira-core-simplified-project-management" }
Check: Delay execution of subsequent rule actions until we've received a response for this web request
3. Store the project ID in a variable
Add component → New action → Create variable
Variable name: targetProjectId
Smart value: {{webResponse.body.id}}
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. Update the project fields with the issue fields
Add component → New action → Send web request
Web request URL: https://profields-cloud.deiser.com/values/projects/{{targetProjectId}}
Headers:
Content-Type: application/json
Authorization: Bearer {{projectrakJwt}} → defined in step 4
HTTP method: POST
Web request body: Custom data
Custom data ( Replace for the Projectrak field ID key and the issue field)
[ { "fieldId": 9754, "value": "{{issue.summary}}" }, { "fieldId": 9752, "value": "{{issue.description}}" } ]