Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

« Previous Version 5 Next »

1. Configure trigger

Create a new trigger → Scheduled

  • Select the basic section

  • Choose your specific time: in this case every day at 06:00 AM

2. Get the authorization token

Add the steps “Get the Projectrak JWT” and then “Store the JWT in a variable“, described at this link: https://deiser-apps.atlassian.net/wiki/spaces/PROJECTRAKCLOUD/pages/1641490/How+to+create+a+Projectrak+authorization+in+Automation+for+Jira?src=search

(warning) 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.

3. Get all projects

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

4. Iterate each project

Add component → New branch → Advanced branching

  • Smart value: {{webResponse.body}}

  • Variable name: project

5. Get the field object

Add component → New action → Send a web request

For this example, our End date field from Projectrak has the id: 10

(warning) Replace using your id

6. Store the field object in a variable

Add component → New action → Create variable

  • Variable name: endDateValue

  • Smart value: {{webResponse.body.value.value}}

7. Compare dates between the current date and end-date of Projectrak.

Add component → New condition → Advanced compare condition

  • First value: {{endDateValue}}

  • Condition: less than

  • Second value: {{projectEnddate}}

8. Get all issues from a project and unresolved

Add component → New action → Lookup issues

  • JQL: project={{project.id}} and resolution is empty

9. Compare the numbers of issues in unresolved

Add component → New condition → Advanced compare condition

  • First value: {{lookupIssues.size}}

  • Condition: does not equal

  • Second value: 0

10. Update project status field

Add component → New action → Send a web request

For this example, our status field from Projectrak has the id: 150166

(warning) Replace using your id

{
 "value": 72176
}
  • Check: Delay execution of subsequent rule actions until we've received a response for this web request

  • Check: Continue running the rule even if the request response is not successful (i.e. non-200 response)

  • No labels