valiantys-logo
Back

New nFeed release: displaying Salesforce data in JIRA issues

At Valiantys, when trying to solve urgent bugs as quickly as possible for our customers, our support consultants often prefer to use the phone rather than JIRA comments.

But this means that our consultants have to dig into Salesforce to find the client’s phone number – what a waste of time and energy!

So they asked why don’t we display the client’s phone number with nFeed? Unfortunately, this wasn’t possible because calls to Salesforce REST API are authenticated with OAuth 2, and nFeed didn’t support this protocol. But that was before…

Now, with nFeed 5.8 you can fetch data from any service using OAuth 2 authentication.

nfeed_oauth_salesforce

Let’s see how you can display Salesforce data in JIRA issues.

Configure the datasource

The first step is to create a new datasource in nFeed that will connect nFeed to the Salesforce REST API.

I won’t go through the details in this article, as everything is explained in our documentation here.

Configure your nFeed field

The second step is to create a nFeed field.

Let’s use the example field Phone number, and add it to the View Issue Screen.

Create nFeed field

Once created, we can configure it from the nFeed configuration page.

Write the SOQL query

Our starting point is the email address of the reporter.

We’ll execute a SOQL query against the Salesforce REST API. SOQL stands for Salesforce Object Query Language. We recommend you look at this documentation to gain a better understanding.

We use the query endpoint and give it a query with the q parameter.

The query in SOQL will be:

SELECT id,phone FROM Contact WHERE Email='$issue.reporter.emailAddress'

As the query is a URL parameter, we need to encode it with encodeURIComponent utility:

query

Locate the data in Salesforce

Now the query is configured, we can test it.

Click on Test query, enter the key of an issue and make sure that the reporter exists in Salesforce CRM.

Query tester

It works – Salesforce returned this JSON:

{
  "totalSize": 1,
  "done": true,
  "records": [
    {
      "attributes": {
        "type": "Contact",
        "url": "/services/data/v20.0/sobjects/Contact/0030Y000001wIAkQAM"
      },
      "Id": "0030Y000001wIAkQAM",
      "Phone": "+1 212-708-9400"
    }
  ]
}

We need to tell nFeed that the data we are interested in is located in the records array.

In the Root path select this array with a JSONPath query:

root-element

If we test the configuration again, this is what we’ll get in the second tab of the query tester:

Query tester, after transformation

This tab displays the JSON after the Root transformation has been applied. It looks like this:

{
  "attributes": {
    "type": "Contact",
    "url": "/services/data/v20.0/sobjects/Contact/0030Y000001wIAkQAM"
  },
  "Id": "0030Y000001wIAkQAM",
  "Phone": "+1 212-708-9400"
}

It’s an array of one element, it contains the contact we are looking for.

We are interested in two attributes:

  • Id is the unique identifier for this record – nFeed will use it to retrieve the record each time the field is displayed.
  • Phone is the data we want to display in our field.

Now let’s configure the JSON columns:

columns

When testing the query, in the third tab of the query tester:

querytester-3

The query configuration is now complete – the next step is to configure how it will be displayed.

The display

The aim of this field is to dispay the data – it isn’t editable.

We select the Read only display mode and choose to display one value only.

We can make this phone number clickable by using the a html tag in the field template.

display

Note: {phone} is a reference to the JSON column defined previously.

Automatically populate an nFeed field upon creation

We want this field to be automatically populated when an issue is created.

The Set a nFeed custom field value post function offers a way to automatically set an nFeed field value during a transition.

This is configured in the Create issue transition:

nFeed post function

Enjoy and relax

Now, each time a customer creates an issue, the phone number field is automatically populated by nFeed.

Result

Ta-dah!

In case you ask… even though nFeed can not (yet) be added to customer requests, this field can be used in any JSD project, and will be visible to the consultants.

With nFeed, our support team can now see, in all issues, the phone number of the reporter. Because the field is connected to Salesforce, any change made in Salesforce will immediately be visible in the issue.

No more time wasting, better SLAs, happy customers and happy consultants!

Wait, there’s more…

In this article, you’ve seen how we use nFeed to fetch important data from Salesforce and display it in a JIRA issue… but that’s not all! With OAuth 2, nFeed can also retrieve data from a wide range of other tools like Google Drive, Zendesk, Google Calendar or Linkedin.

Ready to display Salesforce data in JIRA issues?

Cutted Triangle

Subscribe to Valiantys Newsletter

Registered request ! Subscribing... This is not an email An error occured

In accordance with our privacy policy, we are committed to respecting your personal data.

Contact us

Our Atlassian certified consultants will be happy to answer you.

Join us

We're building the next dream team - Are you in?

Follow us

We use cookies for the operation of our website. This is to improve its use, to personalize your experience, and to compile visitor statistics. By continuing to use this site, you consent to this policy. You can manage the settings and choose whether or not to accept certain cookies whilst browsing. For more information, see our privacy policy. Our privacy policy

Privacy settings

In order to facilitate your navigation and to provide you with the best possible service, we use cookies to improve the site to the needs of our visitors, particularly according to the number of visitors. For more information, please read our privacy policy. Our privacy policy

Recaptcha

Google reCAPTCHA is a system designed to distinguish humans from computers, so that bots are unable to maliciously fill out forms on behalf of a human being.

Analytics

Used to send data to Google Analytics about the visitor's device and behavior. Tracks the visitor across devices and marketing channels. Used by the social sharing platform AddThis to store the user's usage history of the AddThis sharing widget. Registers a unique ID that is used to generate statistical data on how the visitor uses the website.