Using the crm-info servlet to display Jira issues to CRM users

Most users of the CRM plugin use the "JIRA/CRM Field Mappings" to copy JIRA data into CRM where it can be viewed and searched on by CRM users.  However as an alternative you can use the CRM plugin's crm-info servlet to display a screen containing JIRA issues without storing the data in CRM.  The screen returned can be displayed in a new browser window or for Salesforce users it can be "embedded" as a section of a CRM screen.  The biggest advantage of using the crm-info servlet is that you can easily display data from multiple issues.

Example screenshot
crm-info.png

The crm-info servlet is usually invoked by creating custom buttons in CRM on your Account, Contact or Case/Bug screens. If you need details on how to create custom buttons in CRM see the instructions for your CRM system (SalesforceSugarCRM).

The custom button will use a URL to invoke the crm-info servlet. The basic form of the URL is:

https://JIRA-HOST/plugins/servlet/crm-info?crmtoken=TOKEN&account=ACCOUNT-RECORD-ID

In place of "account=ACCOUNT-RECORD-ID" you may also use "contact=CONTACT-RECORD-ID" or "case=CASE/BUG-RECORD-ID".

There are other options available to modify the format of the screen returned by the servlet. The complete list of arguments you may put in the URL's query string is as follows:

  • crmtoken - URL security token from "CRM Setup" screen used to authenticate the URL

  • jira_user - A username used to login to JIRA (optional if "crmtoken" is used)

  • pwd - The password for "jira_user" (optional if "crmtoken" is used)

  • account - Show issues linked to the specified account id

  • contact - Show issues linked to the specified contact id

  • case - Show issues linked to the specified case id

  • cols - The JIRA fields to be displayed in the columns of HTML table (See the table below for possible values). The default is "issue-type,key,summary,assignee,reporter,priority,status,resolution,created,updated,due-date"

  • sort - The sort order. The default is "RESOLUTION:D,PRIORITY:D,DUE-DATE,CREATED"

  • target - Set the "target=" attribute of the HTML links to control what browser window is used when a JIRA issue is clicked on. For example "target=_blank" will open a new window.

  • hide_heading - Skip showing the heading at the top of the page

  • jql - A JIRA JQL expression to use to further filter the search. Note that your expression may contain punctuation characters that have a special meaning when used in a URL, you will need to encode these characters, see URL encoding for details.

  • add_filters - Include links for filters at the bottom of the page

  • filter - Show issues using a specified JIRA filter name


Salesforce users that are familiar with creating Visualforce Pages and would like to embed the HTML table in the middle of a Salesforce layout can use the following apex code as the page definition (use the appropriate values for JIRA-HOST and TOKEN for your installation).

<apex:page standardController="Account">
  <apex:iframe src="http://JIRA-HOST/plugins/servlet/crm-info?crmtoken=TOKEN&hideFooter&account={!Case.AccountId}"/>
</apex:page>

Values for the "cols" argument

These are the possible values for the URL's "cols" argument.  In addition to the following JIRA field names, you may also include JIRA custom fields.  Specify either the name of the custom field or "customfield_nnnnn" where "nnnnn" is the fields's unique id number.

JIRA Field

Description

affected-version

A list of values from the "Affects Version/s" field

assignee

The JIRA username of the user assigned to the issue

assignee-email

The email address of the user assigned to the issue

assignee-fullname

The full name of the user assigned to the issue

component

A list of values from the "Component/s" field

created

The date the issue was created

description

The issue's description

due-date

The date the issue is due

environment

The value from the "Environment" field

estimate

The number of seconds remaining from the original estimate

fix-version

A list of values from the "Fix Version" field

issue-type

The type of the issue.

key

The issue's unique key

labels

A list of the issue's label values

original-estimate

The original time estimate in seconds

parent-id

For sub-tasks, the key of the issue's parent issue

priority

The value from the issue's "Priority" field

project

The name of the project containing the issue

project-category

The Category of the issue's project

project-id

The issue's project's unique id number

reporter

The JIRA username of the issue's Reporter

reporter-email

The email address of the issue's Reporter

reporter-fullname

The full name of the issue's Reporter

resolution

The value from the issue's "Resolution" field

resolved

The date the issue was resolved

security-level

The value from the issue's "Security Level" field

status

The value from the issue's "Status" field

summary

The value from the issue's "Summary" field

time-spent

The time in seconds of the total work logged against the issue

updated

The date the issue was last modified

votes

The number of votes the issue has received