The schema-and-mapping does not include the schema entries for reference types (ie: User). The process i followed was:
- Create the Schema named
Usersin the Assets web UI- Assets → Schemas → Create schema
- Only the left nav: Create a blank schema
- Fill out the form:
- Schema name:
Users - Click Create schema
- Schema name:
- Fill out the form:
- On the schema page, Click Add object type
- Fill out the form:
- Name:
User - Icon:
User - Click Create
- Name:
- Fill out the form:
- Click the Attributes button to switch to Attributes view
- Fill out the empty new line at the bottom of the attributes list
- Name:
Atlassian User - Type:
User - Click Add
- Name:
- Fill out the empty new line at the bottom of the attributes list
- Click the … for the schema and choose Schema settings
- Open the Import tab
-
Click the Create Import button
- Choose External Import
- Set Name to my-import
- Click Create Import
- Choose External Import
-
Click the … button for my-import, choose Generate new token
- Save in file my-import.token
-
Get info with:
curl \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header "Authorization: Bearer $(cat ./my-import.token)" \ --silent https://api.atlassian.com/jsm/assets/v1/imports/info -
Using the
mappinglink, change the/mappingendpoint to/schema-and-mappingcurl \ --silent \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header "Authorization: Bearer $(cat ./my-import.token)" \ "$( curl \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header "Authorization: Bearer $(cat ./my-import.token)" \ --silent \ https://api.atlassian.com/jsm/assets/v1/imports/info \ | jq -r '.links.mapping' \ | sed 's/mapping$/schema-and-mapping/')" \ | jqnotice that the schema supplied does not include the
Atlassian Userfield:{ "schema": { "objectSchema": { "name": "UsersToo", "description": "", "objectTypes": [ { "externalId": "cmdb::externalId/706cfcf4-0e8a-439e-ba3b-dfe3873553bf", "name": "User", "description": "", "inheritance": false, "attributes": [ { "externalId": "cmdb::externalId/c1153fa3-35ae-4be4-9588-373b5f6d5aec", "name": "Key", "description": "", "type": "text", "label": false, "minimumCardinality": 1, "maximumCardinality": 1, "unique": false }, { "externalId": "cmdb::externalId/a9234e28-f7d9-4c77-b128-55f095fd95bb", "name": "Name", "description": "The name of the object", "type": "text", "label": true, "minimumCardinality": 1, "maximumCardinality": 1, "unique": false } ] } ] }, "iconSchema": { "icons": [] } }, "mapping": { "objectTypeMappings": [] } }
-
How can i get the user reference field to synchronize from an incoming mapping via email address if it does not show up in the schema section?
@VishAnkolekar , per our conversation, this is the explicit use case.
I found this community forum post from last year asking a similar question whose answer refers to this knowledge base suggesting after-the-fact Automation, but that seems like a last resort I’d like to avoid having to do…