Fill Additional Mandatory Fields in OTRS from JIRA

Problem

By default OTRS has the following mandatory fields:

  • "Title"

  • "Queue"

  • "State"

  • "Priority"

  • "CustomerUser"

On your OTRS system additionally one (or more) field is marked as required:

  • "Service"

  • "SLA"

  • "Owner"

  • "Type"

  • "Responsible"

You want to fill this field with the value of a JIRA custom field.

Solution

Add a new "Select List (single choice)", "Text field (single line)" or "Text field (multi-line)" custom field on your JIRA system and add all options you need for all of your issue types.

Mark the new custom field in the field configuration dialog as "Required". You can also define a default value for for the new custom field.

In the otrsintegration.properties configuration file, you can configure the mapping of your mandatory OTRS field and the new custom field in the "Mapping Settings" section.

...
# MAPPING SETTINGS
 
# Mappings from JIRA to OTRS.
# A number like in "cust_10100" will be treated as a customfield ID
 
# Mappings from JIRA fields to OTRS Text/Textarea/Dropdown fields
MAPPINGS=1,2,4,5,8,9,10
# Mappings from JIRA Date/Time or Date fields to OTRS Date/Time fields
DATE_TIME_MAPPINGS=6
# Mappings from JIRA Date/Time or Date fields to OTRS Date fields
DATE_MAPPINGS=7
 
# The actual mappings, if the mapping ID is not listed above it will be ignored
MAPPING_1=std_priority,dyn_jirapriority
MAPPING_2=cust_10700, dyn_jiramail
MAPPING_4=std_components,dyn_JiraComponents
MAPPING_5=std_fixForVersion,dyn_JiraFixVersions
MAPPING_6=std_created,dyn_SomeDate
MAPPING_7=cust_Date,dyn_AnotherDate
MAPPING_8=cust_Textarea,dyn_Textarea
MAPPING_9=cust_Dropdown,dyn_Dropdown
MAPPING_10=cust_OtrsOwner,std_owner
...

The mapping is done in the ten line at the end of the example listing above. The syntax is:

MAPPING_<number>=<cf>,<of>

Where <cf> is the name or id of your JIRA customer field and <of> is the name of your mandatory OTRS field.

Do not forget to add the <number> of your new configuration to the MAPPINGS line.