This guide shows how to add a formatted wiki‑markup warning comment on issue creation for a specific customer filter and then pin that comment via REST, all using native Automation for Jira on Data Center.
What you’ll build
A rule that triggers on Issue created, filters with your JQL, adds a bold red comment, waits up to 10 minutes, and pins the new comment so it’s always visible at the top.
Authentication options for the pin step using Personal Access Token (Bearer) or Basic, plus troubleshooting for 401 and 400 errors
Prerequisites and limits
Pinned comments are available in the 9.x line for Jira Software projects; Jira Service Management projects do not support pinning
Have permission to comment and edit issues where the rule will run
Create a Personal Access Token (PAT) if you plan to use Bearer authentication for the web request
The JQL condition
Use a JQL condition in the rule to scope the behavior to the customer key *********
project in (****) AND ( issue.property[dbcf].customfield_19480_BOSS_CUST_ID ~ ******* OR "Customer ID Scope" = ****** OR "Universal Customer Boss ID" ~ **** ) |
This ensures only matching issues receive the warning and pin behavior.
Step 1 — Trigger The {color:red} macro and asterisks for bold are supported in Jira Data Center comments using the wiki renderer.
|
Authentication options
PAT Bearer (recommended): Set header Authorization to “Bearer <your_PAT>” using a Data Center Personal Access Token.
Basic: Build “username:password”, Base64‑encode it, and set Authorization to “Basic <base64>”.
Both approaches work if the account has Comment and Edit Issue permissions on the issue
Full example of the pin request
PUT <BASE_URL>/rest/api/2/issue/{{issue.key}}/comment/{{issue.comments.last.id}}/pin true Replace Authorization with Basic <base64(username:password)> if using Basic auth instead of Bearer. |
Verifying the pin
Optionally add a second Send web request step to GET <BASE_URL>/rest/api/2/issue/{{issue.key}}/pinned-comments and log the response to the audit log.
This makes it easy to confirm the correct comment is pinned in the rule audit without leaving Automation.
Troubleshooting
401 Unauthorized: The Authorization header is missing, malformed, or the user lacks permissions; confirm the header format and account access.
400 Bad Request: Most commonly caused by sending an object in the body (e.g., “Issue data”) instead of the raw boolean true, or by an unresolved comment ID; switch to Custom data with true and ensure you re‑fetch.
Not supported: Pinning is available in the 9.x line for Jira Software but not for Jira Service Management projects; confirm your project type and version.
Ready‑to‑copy rule summary
Trigger: Issue created. Condition: JQL (customer MC003559 filter). Action: Add comment with wiki markup for bold red warning. Action: Re‑fetch issue data. Action: Delay 10 minutes (optional). Action: Send web request PUT /rest/api/2/issue/{{issue.key}}/comment/{{issue.comments.last.id}}/pin with Content-Type: application/json and body true, using PAT Bearer or Basic auth. This pattern strikes a balance between clarity and minimal friction for teams handling customer‑specific triage, while remaining fully native to Jira Data Center automation and REST |
This is always open for suggestion.
Atlassian KB articles for reference
Jayesh Raghuvanshi
0 comments