JSON Configuration Code
To write your JSON configuration code, you have to understand the following:
General Information
The configuration is formatted as JSON data with the attributes specified as follows.
Avoid comments in your JSON configuration code. It is possible that they are not identified correctly as comment.
All fields are required, unless noted otherwise. If the configuration file cannot be parsed or fields are missing, an error message is logged in the Jira log, and the service using the configuration will not work.
Inside a JQL statement, use only single quotes instead of double quotes!
{
"jql":"project = 'iPad App' and reporter = tom.testuser and issuetype = bug"
}
It is (currently) not possible to store the remotePassword in any other format than plaintext.
It would be possible to store the remotePassword Base64 encoded string, but that would not prevent anyone with shell access to the system to be able to obtain the password.
Configuration Options
Configuration Option | Mandatory | Description |
---|---|---|
configurationName | A name or identifier for the configuration. | |
remoteJira | The URL of the remote Jira installation | |
remoteUsername | The username to push changes to the remote Jira. | |
remotePassword | The password to push changes to the remote Jira. | |
username | The username of the local user. Used to execute the JQL search and the local transition. This user name is also used as a sender for escalation emails. | |
issueKeyField | Id of the custom field (on the local Jira) containing the remote issue key, i.e. the issue key of the corresponding issue on the remote system. This field is used to determine the remote issue key in case of an update. If a remote issue does not yet exist, it is created and the remote issue key is stored in this field. If the issue had been created and this field holds the remote issue key and the remote issue is missing skip this issue while logging and error; continue with the next issue. | |
remoteDefaultProject | The key of the default project. Issues that don't yet exist on the remote system will be created in this project. | |
remoteDefaultIssueType | The name of the default issue type. If the issue type of an issue is not available on the remote Jira, this default issue type is used. | |
remoteDefault UserId | The default User of the remote Jira User that should be the reporter/assignee if no match can be found by Usermappings. | |
remoteDefault Priority | The default Priority if priority mapping fails. | |
remoteDefault Board | The default board if board mapping fails. | |
remoteDefault Status | The default status if status mapping fails. | |
remoteTransition | Optional, the transition (id) on the remote system to be executed. | |
escalationMailAddress | The email address to notify in case of any errors. | |
jql | A JQL predicate (where clause) describing which issues should be synced from the local system. The predicate may not contain an "order by" clause (but referenced filters may). | |
attachmentSync | (Optional - default is disabled) Controls the syncing of attachments. Valid values Value values for "enabled" are (case insensitive):
Anything else means disabled, e.g.:
| |
issueSync | Controls the syncing of issues. Value values for "enabled" are (case insensitive):
Anything else means disabled, e.g.:
| |
linkSync | (Optional - default is disabled) Controls the syncing of issue links. Value values for "enabled" are (case insensitive):
Anything else means disabled, e.g.:
| |
componentSync | (Optional - default is disabled) Controls the syncing of components. Value values for "enabled" are (case insensitive):
Anything else means disabled, e.g.:
| |
versionSync | (Optional - default is disabled) Controls the syncing of versions. Value values for "enabled" are (case insensitive):
Anything else means disabled, e.g.:
| |
lastSyncedCommentIdField | Optional. Id of the local field where the last synced comment's id is saved for each issue. If this field is set, comments are synced to the remote system. | |
fieldMappings | An array of field mappings describing the fields to be synced. | |
fieldMappings.localField | The local field to be synced. This may be a custom field id (just the id, or the complete internal name like " The value "key" is treated as the issue's key, even though strictly speaking there is no field "key" in the fields list. | |
fieldMappings.remoteField | The field on the remote system this field will be pushed to. See the above definition for localField. | |
fieldMappings.remoteFieldPrefix | Optional field containing a text prefix that will be added to remote fields (by the push-service). | |
remoteStatusField | Mandatory if remoteTransitions or localTransitions is used | The status field on the remote system. Used to check if remote transitions should be performed. This may be the system field "status" or a custom field id (just the id, or the complete internal name like " |
remoteTransitions | Remote transitions to be performed after sync on the remote issues. |
Available Field Names
Internal field name | Description |
---|---|
summary | The issue summary |
id | The internal issue id |
key | The issue key |
versions | The issue's affected versions |
fixVersions | The versions planned for the fix |
assignee | The issue's assignee |
components | The issue's project components |
created | The creation timestamp (read-only) |
creator | The issue's creator (read-only) (alias for reporter) |
description | The issue's description |
duedate | The issue's planned fix date |
environment | The environment description |
estimate | The time estimate |
issuetype | The issue's type |
originalestimate | The original time estimate |
priority | The issue's priority |
project | The issue's project |
reporter | The issue's reporter |
resolution | The issue resolution |
securitylevel | The issue's security level |
status | The current issue status (read-only) |
timespent | The time spent on the issue |
updated | The last update time (read-only) |
Mappings
Due to the case that there are different IDs for certain values, the Jira Migration App needs mapping tables:
UserMapping
"userMapping":{ "local.userkey":"remoteAtlassianUserId" }
BoardMapping (Boads must be pre-created in remote Jira)
"boardMapping":{ "localBoardId":"remoteBoardId" }
IssueLinkTypeMapping
"issueLinkTypeMapping":{ "localLinkTypeId":"remoteLinkTypeId" }
ResolutionMapping (null for unresolved)
"resolutionMapping":{ "localResolutionId":"remoteResolutionId", "localresolutionID":null }
PriorityMapping
"priorityMapping":{ "localPriorityId":"remotePriorityId" }
IssueTypeMapping
"issueTypeMapping":{ "localIssueTypeName":"remoteIssueTypeName" }
Example
{ "configurationName":"My Configuration", "remoteJira":"https://cwxexample.atlassian.net", "remoteUsername":"admin", "remotePassword":"mypassword", "username":"admin", "issueKeyField":"10100", "remoteDefaultProject":"TEST", "remoteDefaultIssueType":"Task", "remoteTransition":"", "escalationMailAddress":"admin@example.com", "jql":"project = SOMEKEY and issuetype = 'Some special issue type'", "issueSync":"true", "attachmentSync":"true", "fieldMappings":[ { "localField":"summary", "remoteField":"10115", "remoteFieldPrefix":"remote Summary: " }, { "localField":"10340", "remoteField":"description" } ], "remoteStatusField": "status", "localTransitions": { "Open": { }, "In Progress": { "Open": "Start Progress", "Done": "Back to in Progress" } }, "userMapping":{ "bjoern.misch":"0123456789987654321ba", "test.user":"987654321123456789ab" }, "priorityMapping":{ "1":"10000", "2":"10001" }, "resolutionMapping":{ "6":"10014", "1":"10008", "3":null }, "issueTypeMapping":{ "Bug":"Bug", "Task":"Story" }, "boardMapping":{ "5":"18", "6":"29" }, "issueLinkTypeMapping":{ "10000":"10000", "10001":"10001" } }