Explorar el Código

chore: Update Jira issue creation request body to use structured format and add Accept header

David Höck hace 8 meses
padre
commit
a9ab1c156d
Se han modificado 1 ficheros con 27 adiciones y 2 borrados
  1. 27 2
      .github/workflows/sync-jira.yml

+ 27 - 2
.github/workflows/sync-jira.yml

@@ -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