Want to know the step by step process to create issue on JIRA from unix ?

aashish soni May 25, 2017

I am new to JIRA need suggestion

Want to know the step by step process to create issue on JIRA from unix and whats are the requirements like what are the software,api, jar need to be installed or present on machine.... etc

 

1 answer

1 accepted

0 votes
Answer accepted
sasikanth May 25, 2017

You do not require anything more than a CURL to create a Jira Issue from your remote machine.

You can use this request

https://servername:port/rest/api/2/issue is the URI you should hit.

The data portion is a bit complex, you can remove few fields which you are not interested in.

{
"fields": {
"project": {
"id": "10000"
},
"summary": "something's wrong",
"issuetype": {
"id": "10000"
},
"assignee": {
"name": "homer"
},
"reporter": {
"name": "smithers"
},
"priority": {
"id": "20000"
},
"labels": [
"bugfix",
"blitz_test"
],
"timetracking": {
"originalEstimate": "10",
"remainingEstimate": "5"
},
"security": {
"id": "10000"
},
"versions": [
{
"id": "10000"
}
],
"environment": "environment",
"description": "description",
"duedate": "2011-03-11",
"fixVersions": [
{
"id": "10001"
}
],
"components": [
{
"id": "10000"
}
],
"customfield_30000": [
"10000",
"10002"
],
"customfield_80000": {
"value": "red"
},
"customfield_20000": "06/Jul/11 3:25 PM",
"customfield_40000": "this is a text field",
"customfield_70000": [
"jira-administrators",
"jira-software-users"
],
"customfield_60000": "jira-software-users",
"customfield_50000": "this is a text area. big text.",
"customfield_10000": "09/Jun/81"
}
}

Your request may depend on the version of Jira you are using. Please check the documentation. createIssue

I will recommend you to try this with Postman first before using Curl.

See the below example of a simple curl get request to Service desk, your request will also be no different from this except you use POST and add more headers with data.

curl -H "X-ExperimentalApi: true" -u user:pwd -X GET "http://myserver.com:8080/rest/servicedeskapi/servicedesk?start=0&limit=5" | python -mjson.tool

aashish soni May 25, 2017

Thanks for you reply

this question is bit silly... do JIRA needs to be installed on remote machine? where we goning to running our curl command.

another question

I tried postman.. I created basic JIRA account here at logged in https://jira.atlassian.com/

On postman in POST https://jira.atlassian.com/rest/api/2/issue/ and 

 

username password and json 

{
"fields": {
"project":
{
"key": "TST"
},
"summary": "Test API",
"description": "Test description",
"issuetype": {
"name": "Task"
}
}
}

 

but getting 401.

Is my url correct in POST?

sasikanth May 26, 2017

You do not need any local instance of JIRA to create an Issue. You can do it from anywhere provided you have the API access.

I think Postman errors are mostly self explainatory. Please provide proper headers and give a try. I think you havent authorized properly give your credentials in the header to deal with 401.

sasikanth May 30, 2017

Hi Ashish,

If you think the comments helped you, Please mark as a correct answer and vote.

Thanks in advance.

Shasi

Suggest an answer

Log in or Sign up to answer