Create issue and/or data with JSON REST API

I would like to link JIRA up to an existing system to pull data in automatically.

I can think of two ways of doing this:

1) We click on a link in our existing system which sends a JSON REST API request to a HTTP endpoint on JIRA which raises an Issue in JIRA Software and sets some fields based on the JSON values we provide.

2) We open an issue manually type in JIRA, key in a reference number, and click a button which makes a JSON REST API request to a HTTP endpoint hosted by our system, asking for some more details for that reference number and fills in other fields based on that call.

Are either of these possible? All documentation on JSON importing seems to suggest saving it to a local file and important it but that seems a little clunky - would much rather have a REST call lookup if possible.

Thanks,

Barry

3 answers

This widget could not be displayed.

Looks like option 1 is fairly easy as detailed here:

https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-create-issue

So something like this works:

curl -D- -H "Authorization: Basic ZnJlZDpmcmVk" -X POST -d @new_jira.json -H "Content-Type: application/json" "http://jira.laya.ie/rest/api/2/issue/"

Where new_jira.json file contains the following:

{
"fields": {
"project":
{
"key": "TEST"
},
"summary": "REST ye merry gentlemen.",
"description": "Creating of an issue using project keys and issue type names using the REST API",
"issuetype": {
"name": "Task"
}
}
}


Of course in the real world I wouldn't use Curl and so wouldn't need the file but this serves to prove this works.

Very nice and no need for any plugin or the like. I'm impressed.

Option 2 looks a bit more complicated so not sure if that's possible.

 

 

This widget could not be displayed.

I've been playing with Zapier lately (www.zapier.com). It provides an integration with JIRA to create issues.

Can your application make a call to a webhook? If so Zapier can intercept that call along with all the JSON data you send in the body of the request. Zapier can pass this data along to JIRA to create an issue.

I'll probably wirte up a blog article on this at some stage but you can get an idea of what I am talking about here.

I think at the very least this will enable you to test out your integration flow and usability.

The second option you mention is also possible but would require a plugin and that would not be so simple.

Let me know if I can help.

Chris

 

That cert expired on getjirified.com...

 

Validity Period
Issued On Sunday, May 21, 2017 at 8:00:00 PM
Expires On Tuesday, May 22, 2018 at 7:59:59 PM
This widget could not be displayed.

I'm busy developing option 1 to integrate our ITSM-tool with JIRA.

I'm able to create issues in JIRA, but only with string lined calls.

Now i'm stuck on the description field.

For example: if the description field in our ITSM-tool is filled with tons of information in several lines, the api-call will fail.

I am not able to parse that information to a string. The ITSM-tool doesn't have any solutions for this.

JIRA_description_field.jpg

As you can see, field description is a variable (verzoek) of our ITSM-tool. In the process of sending the information to JIRA field description will be filled in automatically with text of our ITSM-tool. Often this variable is filled with information on several lines.

Does anyone have a solution for this?

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

72 views 1 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you