How to connect OTRS with JIRA

Robert Ullrich, 14. Nov 2016 | Use cases

With the new OTRS Business Solution™ 5s you have the possibility to create and update issues in JIRA using the JIRAConnector. The following article will explain how to configure this JIRAConnector.

Requirements for the JIRAConnector

You are able to connect to JIRA, if you meet the prerequisites which are listed below:

OTRS Framework

The following OTRS framework is required:

  • 5.0.x

OTRS Packages

You need the following Freely selectable Features of the OTRS Business Solution™ 5s :

  • OTRSGenericInterfaceInvokerTicket
(Adds new invoker for TicketCreate and TicketUpdate in the GenericInterface.)
  • OTRSGenericInterfaceInvokerEventFilter
(Contains additional functionalities to add conditions to events of invokers.)

Third Party Software

You need this third party software:

  • XML::Simple
  • XML::LibXML
  • XML::LibXSLT

DynamicFields

  • DynamicField „JiraIssueID“ of type „TEXT“

When you’re done with the pre-requirements, you have to create a new web service within OTRS to set up the needed requester invokers:

Create a new Webservice

Configuration of the JIRAConnector

Please select „XSLT“ for the outgoing and incoming mapping in the configuration of the invoker „IssueCreate“,

Configure IssueCreate

Afterwards you have to define a valid XML structure to map the OTRS structure to a structure which can be understand by JIRA.

IMPORTANT: You need some basic XML and XPATH knowledge

I use the following outgoing mapping:

Outgoin Mapping for IssueCreate

Also the response format of JIRA is not in an OTRS structure. You have to specify an incoming mapping too:

Incoming Mapping

Now we need to define a trigger which will execute the request to JIRA e.g.: TicketLockUpdate for test purposes.

Click on „save and finish“ when you finished the configuration

We will do the same for the invoker “IssueUpdate”. Click on it or create it, if you haven’t done until now and use the following XSLT Mapping for outgoing request data:

IssueCreate Outgoing Mapping

As you can see i will only update the Summary in JIRA and i’m using the latest OTRS Ticket Title.

When you’re satisfied with your mapping, please click on „Save and finish“.

Go to the „Network Transport“ configuration of the JIRAConnector and change the following settings.

Configure Transport

You need at least the following information:

  • Host:
    • http://<YOUR_FQDN/rest/api/2
  • Controller Mapping for ‚IssueCreate’:
    • /issue (Request Command: POST)
  • Controller Mapping for ‚IssueUpdate’:
    • /issue/:JIRAIssueID (Request Command: PUT)
  • Username:
    • A valid user for the JIRAConnector
  • Password
    • A valid password for the user

Before you can test the new web service, you have to configure a DynamicField in the SysConfig (e.g.: JIRAIssueID) which is used to store the response of JIRA.

See attached image:

SysConfig Settings

 Testing the JIRAConnector

Now we can use a ticket and lock it.

The request to JIRA will look like the following, if the mapping was applied to the outgoing request. You can find this information, if you go to the Debugger of the JIRAConnector.

Request after Mapping was applied

The request to JIRA was a success, if you see the following answer:

Response before Mapping

OTRS can only store one response value of the response, you created the incoming mapping for the response data. The result of this mapping is:

Response after Mapping

 

 

Congratulations! You successfully connected OTRS with JIRA.

 

More information

You can also use other resources which are provided by JIRA. Please go to the following website, if you need information: https://docs.atlassian.com/jira/REST/cloud/

 

Your email address will not be published. Required fields are marked *

This site uses cookies. By continuing to use the site, you agree to the use of cookies. More information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close