|
|
@@ -76,8 +76,32 @@ jobs:
|
|
|
if [ -z "$KEY" ]; then
|
|
|
echo "No existing ticket found, creating new one"
|
|
|
BODY=$(jq -n --arg summary "$SUMMARY" --arg desc "$DESC" --arg proj "$PROJECT_KEY" '
|
|
|
- {fields:{project:{key:$proj},summary:$summary,description:$desc,
|
|
|
- issuetype:{name:"Task"},labels:["core-team"]}}' || {
|
|
|
+ {
|
|
|
+ "fields": {
|
|
|
+ "project": {
|
|
|
+ "key": $proj
|
|
|
+ },
|
|
|
+ "summary": $summary,
|
|
|
+ "description": {
|
|
|
+ "type": "doc",
|
|
|
+ "version": 1,
|
|
|
+ "content": [
|
|
|
+ {
|
|
|
+ "type": "paragraph",
|
|
|
+ "content": [
|
|
|
+ {
|
|
|
+ "type": "text",
|
|
|
+ "text": $desc
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "issuetype": {
|
|
|
+ "name": "Task"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }' || {
|
|
|
echo "Error creating request body"
|
|
|
exit 1
|
|
|
})
|
|
|
@@ -87,6 +111,7 @@ jobs:
|
|
|
# Create with error checking
|
|
|
CREATE_RESULT=$(curl -f -s -u "$JIRA_EMAIL:$JIRA_TOKEN" \
|
|
|
-H "Content-Type: application/json" \
|
|
|
+ -H "Accept: application/json" \
|
|
|
--data "$BODY" "$JIRA_BASE/rest/api/3/issue" || {
|
|
|
echo "Error: Jira create failed with status $?"
|
|
|
exit 1
|