Integrate Service Manager with Jira Software and Jira Confluence

Dear everyone,

I have questions about how to integrate directly SM with Jira.

1. Is it possible to integrate the SM with Jira Software to sync the URD, Epic, and Task... from Jira to the specific module in SM?

2. Is it possible to integrate to retrieve the Documents list from Confluence and display it in SM?

If yes, hope you can help to guide me on how to do that.

Thanks.

  • 0

    1:  It's possible both to retrieve any ticket from jira and map it to whatever you want on SM9 side utilizing the Jira REST API.  Tickets from Jira to SM9 can be handled either as WebHooks in Jira sending information to SM9 - I would suggest going through a custom transaction table in SM9 so you have full control of what's happening or you can use a get function to retrieve. 
    Update back to Jira is a bit more complex due to a quite rigid structure in how updates are handled, but yes it's possible.  Biggest issue is uploading attachments as Jira doesn't support base64Encoding OutOfBox so you have to upload with multipart/form-data and adding binary data to that doesn't work (at least for me) in SM9.72 JavaScript.  We have used 'curl' in between as workaround for that function.
    Remember - there are not two similar Jira systems out there so your field mapping need to be flexibel - here is an example of an update transaction:
    {"update":{"comment":[{"add":{"body":"Status Changed from: Updated By Customer to: Solved"}}],"customfield_11714":[{"set":"SD33612226"}]},"fields":{"customfield_11719":"Closed - On Hold","customfield_11687":"3","customfield_16100":"11053839403","customfield_16007":"CI4062857","customfield_14204":{"id":"16100"},"customfield_16009":"Application","customfield_16011":"N/A","customfield_15600":{"id":"16617"},"customfield_12407":"Personal Internet Banking / FS\n"}}
    Here is a link to the Jira documentation as well:  https://developer.atlassian.com/server/jira/platform/rest-apis/

  • 0 in reply to 

    Hi Jan.

    Thank you for your suggestion.

    Do you know the sample script to create a page Confluence from SM via REST API?

    I can do it by Postman successfully, but when put code to SL of SM it can't combine Slight smile

    Thanks.

    Neo.

  • 0 in reply to 

    Haven't integrated to Confluence, but what kind of issue do you have? 

    I also need to mention that in SM9.8 a new function is added so you can also integrate to Jira for uploads without the workaround I mentioned.  This 'new ByteBuffer()' works perfectly well towards Jira, but it still have some issues so I  cannot do the same upload towards Remedy as an example.  It's not possible to combine string and binary in multipart/form-data payload (doHTTPRequest will fail).

    SM9.8 has full support OOB for Jira integration, I'm not using that since we built our own multivendor/multicustomer integration engine - has been running since SM7 and ported/improved along with new versions.

  • 0 in reply to 

    I'm having trouble with sending 'POST' request using doHTTPRequest to create new ticket. The 'headers' and request body can not be sent. Is it possible to send request via doHTTPRequest with JSON string body and headers

  • 0 in reply to 

    I'm having trouble with sending 'POST' request to create a new "Content" ticket on Confluence via doHTTPRequest. Confluence RestAPI requires a basic auth header. I've created a header in JSON string and a request body in JSON, either. However, the request can not be sent. Could you please provide instructions to send a 'POST' request to the doHTTPRequest function?

  • 0 in reply to 

    let URL = "xxxxxxx.xxxxxx.com/xxx';
    let httpHeaders = lib.smis_RestClient.createBasicAuthHttpHeaders("en", USER,PASS); //User and Password added here
    let httpcontentHeader = new Header("Content-Type", "application/json");
    httpHeaders.push(httpcontentHeader);
    delete(httpcontentHeader);
    let myDataJSON = lib.JSON2.toJSON(myCurrentJSON);  //myCurrentJSON is the JSON file you already have
    let postResponse = doHTTPRequest("POST", URL, httpHeaders, myDataJSON);
    print("###postResponse: "+postResponse);

  • 0 in reply to 

    Example of payload (string) to send to create ticket:

    {"fields":{"project":{"key":"JiraProjectID"},"issuetype":{"name":"User Story"},"reporter":{"name":"yourOperator"},"summary":"Agreement - AgreementUse - Add User, must use Company Code not Name","customfield_21394":"ExampleCompnay","customfield_25491":"ExampleUser","description":"When adding a new company in an agreement, you must use the code for the company and not the name.\nShould be name","customfield_22690":"RFT30798167","customfield_10240":"Task Completed","customfield_25203":"Better Tool"}}

    Remember - the only thing you can pick from this is the structure - customefield id's, project keys etc. are installation specific.

    You can reuse the doHTRPRequest setup from my previous answer if BasicAuth is used - is it OAUTH it becomes a bit more complex.