Good morning
I am using JIRA in my company.
I've been using JIRA to find out that there is an API and I'm testing it.
I tested using bash to automatically generate JIRA, and I was successful
#!/bin/bash
jira_user="id"
jira_pw="pass"
jira_server="jira.test.com"
project="SECURITY"
issuetype="Inquiry"
api_data="{\"fields\":{\"project\":{\"key\":\"${project}\"},\"summary\":\"jira test\",\"description\": \"my description\",\"issuetype\":{\"name\":\"${issuetype}\"}}}"
curl -u "${jira_user}":"${jira_pw}" -w "<%{http_code}>" -H "Content-Type: application/json" https://${jira_server}/rest/api/2/issue/ -X POST --data "${api_data}"
The reason I leave an article is
Assignee can not be specified.
api_data="{\"fields\":{\"project\":{\"key\":\"${project}\"},\"summary\":\"test\",\"description\": \"my description\",\"issuetype\":{\"name\":\"${issuetype}\"}}}"
api_data2="{\"fields\":{\"assignee\":{\"name\":\"${assignee}\"}
->
[incle@incle jira]$ ./jira2.sh
./jira2.sh: line 17: unexpected EOF while looking for matching `"'
./jira2.sh: line 18: syntax error: unexpected end of file
Hello,
Do you mean, that you have some kind of error ,when you specify an assignee? What is the error?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
api_data="{\"fields\":{\"project\":{\"key\":\"${project}\"},\"summary\":\"my summary\",\"description\": \"my description\",\"issuetype\":{\"name\":\"${issuetype}\"}}}"
Is there an option here to change the assginee?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You missed a couple of parenthises
api_data2="{\"fields\":{\"assignee\":{\"name\":\"${assignee}\"}}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.