Push to Jira

Pushes a production status description table to the Jira ticket linked to the specified job. The endpoint appends a Jira wiki markup table to the ticket's existing description, showing the current serial number distribution across process steps for each path, timestamped with today's date. This creates a running log of production progress directly on the Jira ticket.

Both the enabled and pushEnabled toggles must be active in App Settings. The job must have a linked Jira ticket (jiraTicketKey must be set), and the job must have at least one path defined.

The push operation:

  1. Fetches the current ticket description from Jira via GET
  2. Computes the step distribution (serial counts per step) for each path
  3. Builds a Jira wiki markup table with step names as columns and today's counts as a data row
  4. Appends the table(s) to the existing description
  5. Updates the ticket via PUT

Request

Request Body

FieldTypeRequiredDescription
jobIdstringYesThe ID of the job whose data should be pushed to Jira. The job must have a linked Jira ticket.

Response

200 OK

Returns a JiraPushResult indicating success or failure.

FieldTypeDescription
successbooleantrue if the push completed successfully
errorstring | undefinedError message if success is false

400 Bad Request

ConditionMessage
Jira integration is disabled"Jira integration is not enabled"
Jira push is disabled"Jira push is not enabled"
jobId is missing or empty"jobId is required"

404 Not Found

ConditionMessage
Job does not exist"Job not found: {jobId}"

502 Bad Gateway

ConditionMessage
Jira API unreachable during GET or PUT"Jira API error: {status} {statusText}"

Examples

Request

curl -X POST http://localhost:3000/api/jira/push \
  -H "Content-Type: application/json" \
  -d '{
    "jobId": "job_abc123"
  }'

Response — Success

{
  "success": true
}

Response — Job not linked to Jira

{
  "success": false,
  "error": "Job is not linked to a Jira ticket"
}

Response — Job has no paths

{
  "success": false,
  "error": "Job has no paths"
}

Notes

  • The description table is appended to the existing ticket description, not replaced. Each push adds a new timestamped table, creating a historical log.
  • The wiki markup format uses Jira's table syntax: || Header || for header cells and | Data | for data cells.
  • Each path generates its own table section, prefixed with the path name in bold.
  • The "Completed" column shows the count of serials that have finished all steps (step index = -1).
  • If the Jira API call fails during the push, the error is caught and returned as { success: false, error: "..." } rather than throwing a 502.
  • Pushing to the same ticket multiple times is safe — each push appends a new dated row.
  • The mode field from PushToJiraInput is not used by this endpoint. The push endpoint always writes a description table. For comment summaries, use the Comment endpoint.