Versions Compared

Key

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

Crumbs is being retired on 31 December 2024. Read the announcement here

Table of contents

Table of Contents

...

  1. In Crumbs, create a customer and add information into a field.

  2. In Jira Automation, setup an automation to read the linked customer, lookup the customer and copy customer values to an issue.

  3. In Jira, link a customer to an issue.

Jira Automation Steps

Step

Component

Details

1

When: Field value changed

This is a

The trigger

, and

can be

any moment in time

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

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

Image Added

Web request: https://crumbs

-prod

.

newverveconsulting

newverve.

com

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

Use the Crumbs API to get the customer details.

Image Added

Web request: https://crumbs

-prod

.

newverveconsulting

newverve.

com

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

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

Email main contact when customer is linked

...

  1. In Crumbs, create a customer with a main contact.

  2. In Jira Automation, setup an automation to read the linked customer, lookup a customer and email the main contact.

  3. In Jira, create an issue and link the customer.

Jira Automation Steps

Step

Component

Details

1

When: Field value changed

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

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

Image Added

Web request: https://crumbs

-prod

.

newverveconsulting

newverve.

com

scot/api/1/

customer

issueLink/{{

webResponse.body.customerIds.first

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

Use the Crumbs API to get the customer details.

Image Added

Web request: https://crumbs

-prod

.

newverveconsulting

newverve.

com

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

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:

  • Name: Authorization

  • Value:

Bearer <Jira 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: Send email

Now we can send the email out.

Image Added

To: {{webResponse.body.emailAddress}}

Fill in the desired email details.

Link a customer automatically when an issue is created

...

  1. In Crumbs, create a customer.

  2. In Jira Automation, setup an automation to link a customer.

  3. In Jira, create an issue.

Jira Automation Steps

Step

Component

Details

1

When: Issue is created

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

Image Added

2

Then: Send web request

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

Image Added

Web request:

`https

https://crumbs

-prod

.

newverveconsulting

newverve.

com

scot/api/1/issueLink/{{issue.key}}

Header:

  • Name: Authorization

  • Value: Bearer <Crumbs API token>

HTTP method:

GET

POST

Web request body: Custom Data

Custom data:

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

Use GET /customer to get the customerId.

Modify customer based on issue information

...

  1. In Crumbs, create a customer and a line field for ‘Budget Used’.

  2. In Jira administration, create a ‘Cost’ number field and add it to the screen.

  3. In Jira Automation, setup the automation to increment the budget by the issue cost.

  4. In Jira, populate the cost field for an issue and link a customer to the issue and trigger the automation, for example by transitioning the issue.

Jira Automation Steps

Step

Component

Details

1

When: Issue is transitioned

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

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

Image Added

Web request: https://crumbs

-prod

.

newverveconsulting

newverve.

com

scot/api/1/

customer

issueLink/{{

webResponse.body.customerIds.first

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

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

Use the Crumbs API to get the customer details.

Image Added

Web request: https://crumbs

-prod

.

newverveconsulting

newverve.

com

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

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

Use the Crumbs API to modify the customer details.

Image Added

Web request: https://crumbs

-prod

.

newverveconsulting

newverve.

com

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