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 OptionMandatoryDescription
configurationName(tick)A name or identifier for the configuration.
remoteJira(tick)The URL of the remote Jira installation
remoteUsername(tick)The username to push changes to the remote Jira.
remotePassword(tick)The password to push changes to the remote Jira.
username(tick)

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(tick)

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(tick)The key of the default project. Issues that don't yet exist on the remote system will be created in this project.
remoteDefaultIssueType(tick)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.
remoteDefaultUserId(tick)The default User of the remote Jira User that should be the reporter/assignee if no match can be found by Usermappings.
remoteDefaultPriority
The default Priority if priority mapping fails.
remoteDefaultBoard
The default board if board mapping fails.
remoteDefaultStatus
The default status if status mapping fails.
remoteTransition
Optional, the transition (id) on the remote system to be executed.
escalationMailAddress(tick)The email address to notify in case of any errors.
jql
(tick)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):

  • "true"
  • "on"
  • "yes"

Anything else means disabled, e.g.:

  • "false"
  • "off"
  • "no"
  • ""
issueSync

Controls the syncing of issues.

 Value values for "enabled" are (case insensitive):

  • "true"
  • "on"
  • "yes"

Anything else means disabled, e.g.:

  • "false"
  • "off"
  • "no"
  • ""
linkSync

(Optional - default is disabled) Controls the syncing of issue links.

 Value values for "enabled" are (case insensitive):

  • "true"
  • "on"
  • "yes"

Anything else means disabled, e.g.:

  • "false"
  • "off"
  • "no"
  • ""
componentSync
(Optional - default is disabled) Controls the syncing of components.


 Value values for "enabled" are (case insensitive):

  • "true"
  • "on"
  • "yes"

Anything else means disabled, e.g.:

  • "false"
  • "off"
  • "no"
  • ""
versionSync

(Optional - default is disabled) Controls the syncing of versions.


 Value values for "enabled" are (case insensitive):

  • "true"
  • "on"
  • "yes"

Anything else means disabled, e.g.:

  • "false"
  • "off"
  • "no"
  • ""
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(tick)An array of field mappings describing the fields to be synced.
fieldMappings.localField(tick)

The local field to be synced.

This may be a custom field id (just the id, or the complete internal name like "customfield_10200") or the name of a builtin field (e.g., summary).

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(tick)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).

remoteStatusFieldMandatory 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 "customfield_10200").

remoteTransitions

Remote transitions to be performed after sync on the remote issues.

Available Field Names

Internal field nameDescription
summaryThe issue summary
idThe internal issue id
keyThe issue key
versions

The issue's affected versions

fixVersionsThe versions planned for the fix
assigneeThe issue's assignee
componentsThe issue's project components
createdThe creation timestamp (read-only)
creatorThe issue's creator (read-only) (alias for reporter)
descriptionThe issue's description
duedateThe issue's planned fix date
environmentThe environment description
estimateThe time estimate
issuetypeThe issue's type
originalestimateThe original time estimate
priorityThe issue's priority
projectThe issue's project
reporterThe issue's reporter
resolutionThe issue resolution
securitylevelThe issue's security level
statusThe current issue status (read-only)
timespentThe time spent on the issue
updatedThe 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

Example Configuration File in JSON Format
 {
    "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"
    }
 }