POST /api/associations
Before you start
Before you start working with REST APIs, make sure you have:
Set up your integration in Jira DC - connection, integration user, and binding.
For details, see Set up your integration in Jira DC.Associate a Salesforce Case record with a Jira work item
Get a Personal Access Token in Jira DC (User Avatar → Profile → Personal Access Tokens) and use it in a cURL.
For details, see Personal Access Tokens.
Endpoint: POST /api/associations?jiraIssueIdOrKey={}&replace={true/false}
Description
Allows adding multiple associations for a single Jira work item. The replace parameter determines whether existing associations are overwritten.
Query parameters
jiraIssueIdOrKey(string, required): The Jira work item ID or keyreplace(boolean, optional): Whether to replace existing associations. The default value is set to false
Authentication setup
You have two authentication options:
With Personal Access Token (PAT) (recommended)
curl -X POST "https://your-jira-instance.com/rest/com.servicerocket.jira.salesforce/1.0/api/external/associations?jiraIssueIdOrKey=<jira issue id or key>&replace=false" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <PAT>"// YOUR_PERSONAL_ACCESS_TOKEN
-d '[
{
"son": "Case",
"soid": "001XXXXXXXXXXXXXXX",
"viewOnly": false,
"autoPush": false,
"autoPull": false
},
{
"son": "Case",
"soid": "002XXXXXXXXXXXXXXX",
"viewOnly": false,
"autoPush": false,
"autoPull": false
}
]'With basic authentication
Use your Jira username and password (less secure, not recommended for production)
curl -X POST "https://your-jira-instance.com/rest/com.servicerocket.jira.salesforce/1.0/api/external/associations?jiraIssueIdOrKey=<jira issue id or key>&replace=false" \
-H "Content-Type: application/json" \
-u "login:password"
-d '[
{
"son": "Case",
"soid": "001XXXXXXXXXXXXXXX",
"viewOnly": false,
"autoPush": false,
"autoPull": false
},
{
"son": "Case",
"soid": "002XXXXXXXXXXXXXXX",
"viewOnly": false,
"autoPush": false,
"autoPull": false
}
]'Request body
son(string, required): Salesforce object type name, for example,Case,Account,Contact.soid(string, required): Salesforce object ID for the specific record associated with the Jira work item.viewOnly(boolean, optional):truefor a view-only association.autoPush(boolean, optional):truefor automatic data push from Jira to Salesforce.autoPull(boolean, optional):truefor automatic data pull from Jira to Salesforce.
Example request body
[
{
"son": "Case",
"soid": "500J80000019IF9IAM",
"viewOnly": false,
"autoPush": false,
"autoPull": false
}
]
Example response body
data mirrors back the provided associations input from the request body
{
"data": [
{
"son": "Case",
"soid": "500J80000019IF9IAM",
"viewOnly": false,
"autoPush": false,
"autoPull": false
}
],
"message": "Associations added successfully",
"success": true
}Constraints
Maximum 1000 associations per Jira work item.
When
replace=true, all previous associations are removed before adding the new ones.Existing associations are not duplicated when
replace=false.
Related pages
Need support? Create a request with our support team.
