Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Step

Component

Details

1

When: Field value changed

Image Removed

The trigger can be actioned anytime you wish to copy the customer details over to the issue. Note that customers are linked after issue creation (which means that it must be triggered on issue update.

Image Added

Fields to monitor for changes: Customer

Change type: Any changes to the field value

For: Edit issue

2

Then: Send web request

Image Removed

Use the Crumbs API to find the customerId of the customer linked.

Image Added

Web request: https://crumbs.newverve.scot/api/1/issueLink/{{issue.key}}

Headers:

  • Name: Authorization

  • Value: Bearer <Crumbs API token>

HTTP method: GET

Web request body: Empty

Wait for response:

  • Delay execution of subsequent rule actions until we've received a response for this web request

3

And: Send web request

Image Removed

Use the Crumbs API to get the customer details.

Image Added

Web request: https://crumbs.newverve.scot/api/1/customer/{{webResponse.body.customerIds.first}}

Headers:

  • Name: Authorization

  • Value: Bearer <Crumbs API token>

HTTP method: GET

Web request body: Empty

Wait for response:

  • Delay execution of subsequent rule actions until we've received a response for this web request

4

And: Edit issue fields

Image Removed

Change an issue field to something based on the data from the Crumbs customer linked.

Image Added

Choose fields to copy customer to e.g.

Request participant: {{webResponse.body.fields.mainContact}}

If you are copying a custom field, you will need to know the fieldId. You can find this with GET /field. e.g. if the fieldId is 0a647c60-2513-40c2-a61a-2683cf19c1dd, to access the field use the following smart value:

{{webResponse.body.fields.0a647c60-2513-40c2-a61a-2683cf19c1dd}}.

...

Step

Component

Details

1

When: Field value changed

Image Removed

Detect a field value change to trigger this automation.

Image Added

Fields to monitor for changes: Customer

Change type: Any changes to the field value

For: Edit issue

2

Then: Send web request

Image Removed

Use the Crumbs API to find the customerId of the customer linked.

Image Added

Web request: https://crumbs.newverve.scot/api/1/issueLink/{{issue.key}}

Header:

  • Name: Authorization

  • Value: Bearer <Crumbs API token>

HTTP method: GET

Web request body: Empty

Wait for response:

  • Delay execution of subsequent rule actions until we've received a response for this web request

3

And: Send web request

Image Removed

Use the Crumbs API to get the customer details.

Image Added

Web request: https://crumbs.newverve.scot/api/1/customer/{{webResponse.body.customerIds.first}}

Header:

  • Name: Authorization

  • Value: Bearer <Crumbs API token>

HTTP method: GET

Web request body: Empty

Wait for response:

  • Delay execution of subsequent rule actions until we've received a response for this web request

4

And: Send web request

Image Removed

Use the Jira API to convert the user accountId to an email address. See Get user for more information.

Image Added

Web request: https://<site>.atlassian.net/rest/api/3/user?accountId={{webResponse.body.fields.mainContact}}

Header:

HTTP method: GET

Web request body: Empty

Wait for response:

  • Delay execution of subsequent rule actions until we've received a response for this web request

5

And: Send email

Image Removed

Now we can send the email out.

Image Added

To: {{webResponse.body.emailAddress}}

Fill in the desired email details.

...

Step

Component

Details

1

When: Issue is created

Use the issue created trigger to run this automation when any issue is created.

2

Then: Send web request

Image Removed

Use the Crumbs API to link a customer to the issue.

Image Added

Web request: https://crumbs.newverve.scot/api/1/issueLink/{{issue.key}}

Header:

  • Name: Authorization

  • Value: Bearer <Crumbs API token>

HTTP method: POST

Web request body: Custom Data

Custom data:

Code Block
{
    "customerId": "<customerId>"
}

Use GET /customer to get the customerId.

...

Step

Component

Details

1

When: Issue is transitioned

Image Removed

Example trigger when an issue is marked done to add the cost of the issue to the budget used.

Image Added

From status: In Progress

To status: Done

2

Then: Send web request

Image Removed

Use the Crumbs API to find the customerId of the customer linked.

Image Added

Web request: https://crumbs.newverve.scot/api/1/issueLink/{{issue.key}}

Header:

  • Name: Authorization

  • Value: Bearer <Crumbs API token>

HTTP method: GET

Web request body: Empty

Wait for response:

  • Delay execution of subsequent rule actions until we've received a response for this web request

3

And: Create variable

Image Removed

Save the smart value customerId to be used in later steps.

Image Added

Variable name: customerId

Smart value: {{webResponse.body.customerIds.first}}

4

And: Send web request

Image Removed

Use the Crumbs API to get the customer details.

Image Added

Web request: https://crumbs.newverve.scot/api/1/customer/{{customerId}}

Header:

  • Name: Authorization

  • Value: Bearer <Crumbs API token>

HTTP method: GET

Web request body: Empty

Wait for response:

  • Delay execution of subsequent rule actions until we've received a response for this web request

5

And: Create variable

Image Removed

Calculate the total and save it to a variable. This step is optional but makes it easier to explain.

Image Added

Variable name: total

Smart value: {{#=}}{{issue.fields.<Cost issue field ID>|0}} + {{webResponse.body.fields.<Budget customer field ID>.asNumber|0}}{{/}}

The smart value is broken down into:

  • {{#=}} - The start of a maths expression.

  • {{issue.fields.<Cost custom field ID>|0}} - The Cost issue field value.

    • Replace <Cost custom field ID> with the ID of the custom field e.g. customfield_10001. This can be found using the GET /field Jira API.

    • |0 - will default the value to 0.

  • + Here we are adding the cost of the issue to the existing budget used.

  • {{webResponse.body.fields.<Budget customer field ID>.asNumber|0}} - The Budget Used customer field value.

    • Replace <Budget customer field ID> with the ID of the custom field e.g. cc659e96-cb91-4e81-a8fa-cdf222c2dcef. This can be found using the GET /field Crumbs API.

    • |0 - will default the value to 0.

  • {{/}} - The end of the maths expression.

6

And: Send web request

Image Removed

Use the Crumbs API to modify the customer details.

Image Added

Web request: https://crumbs.newverve.scot/api/1/customer/{{customerId}}

Header:

  • Name: Authorization

  • Value: Bearer <Crumbs API token>

HTTP method: PUT

Web request body: Custom data

Custom data:

Code Block
{
    "<Budget customer field ID>": {{total}}
}
  • Replace <Budget customer field ID> with the ID of the custom field e.g. cc659e96-cb91-4e81-a8fa-cdf222c2dcef. This can be found using the GET /field Crumbs API.

Wait for response:

  • Delay execution of subsequent rule actions until we've received a response for this web request

...