You are viewing the old version of the documentation. See the latest version here: CRM for Jira Server Home

Versions Compared

Key

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

What for need CRM API

It need that external applications can programmatically add and receive data to CRM. To work with the API, you must configure the security key (password) and the rights of the user that will be connected.

Setting access to API

For access to API you need to specify the API Key (password) in the Administration/Plugins/CRM/Access:

Image Added

Access rights to CRM objects

To receive data via API, you can use different users with different access rights. Access rights to the objects defined in the Administration/Plugins/CRM/Access:

Image Added

Supported methods

 

Method's nameUser rightDescription

To do some actions with CRM data you can use CRM API. Now we have authorization in API. For access in API you need:

  • apiKey 

Image Removed

 

(Set in CRM Administration panel in Access inlay.) 

 

  • userName

(Login of JIRA's user, which will perform all actions)

 

As now all actions will be performed under the JIRA's user, he owe to have all rights for access to methods.

Image Removed

 

For access to:A user owe to have rights:Function properties:
getcompanybynameCRM Main MenuReturn company by name or ID
getcontactbynameCRM Main MenuReturn contact by name or ID
getcompaniesCRM Main MenuReturn all companies
getcontactsCRM Main MenuReturn all contacts
sync CRM Main MenuStart synchronization of JIRA users
setcrmpropertiesCRM Main MenuSet custom field type "Crm Property" in issue
addcompanyAdd companiesAdd company
setcontactAdd contactsSet company for contacts

 

How now owe to look method's calls :

1.

...

Calls examples.

 

Start synchronization:

http://

...

2.

 

Register organization "Adobe" to contact "Ted Johnson":

...

http://

...

YOURDOMAIN/plugins/servlet/crm/api?apiKey=${apiKey}&userName=${userName}&command=setcontact&companyName=Adobe&contactName=TedJohnson

3.

...


Receive organization with ID=15 and contact with ID=6:

http://

...

YOURDOMAIN/plugins/servlet/crm/api?apiKey=${apiKey}&userName=${userName}&command=setcontact&companyId=15&contactId=6

...

 

...

http://

...

YOURDOMAIN/plugins/servlet/crm/api?apiKey=${apiKey}&userName=${userName}&command=addcompany&clients-org_name=test

...

 Company Name&clients-org_www=test.com&tableName=CLIENTS&view-clients-org_industry=Consulting&view-clients-org_sla=SLA-1

...

Free

Value:
Need to replace on:
${apiKey}
key's value (adjusted in Plugin administration panel)
${userName}
JIRA user's login

Here is an examples of a new method's calls.

1.

...

 

Receive all organizations:

http://

...

YOURDOMAIN/plugins/servlet/crm/api?apiKey=${apiKey}&userName=${userName}&command=getcompanies

2.

...

 

Receive all contacts:

http://

...

YOURDOMAIN/plugins/servlet/crm/api?apiKey=${apiKey}&userName=${userName}&command=getcontacts

3.

...

 

Receive organization with ID=2:

http://

...

YOURDOMAIN/plugins/servlet/crm/api?apiKey=${apiKey}&userName=${userName}&command=getcompanybyname&companyId=2

4.

...

 

Receive organization with name "Teamlead":

http://

...

YOURDOMAIN/plugins/servlet/crm/api?apiKey=${apiKey}&userName=${userName}&command=getcompanybyname&companyName=

...

Teamlead

5.

...

 

Receive contact with ID=2:

http://

...

YOURDOMAIN/plugins/servlet/crm/api?apiKey=${apiKey}&userName=${userName}&command=getcontactbyname&contactId=2

6.

...

 

Receive contact with name "Vladimir Putin":

http://

...

YOURDOMAIN/plugins/servlet/crm/api?apiKey=${apiKey}&userName=${userName}&command=getcontactbyname&contactName=

...

Vladimir Putin


where:

  • ${apiKey} - key's title
  • ${userName} - JIRA user's login