Apps documentation
Extension for Jira Service Management
Cloud Server/Data Center
Extension for Jira Service Management

Cloud

Server/Data Center

Documentation
FAQ
Release notes
Articles & Videos
Last updated Jan 21, 2020

Bundled Fields (version 6.7.x and earlier)

This section provides information on configuring Bundled Fields in Extension v.6.7.x and earlier.

Note
If you use Extension v.6.8.x. or later, go to this page.

A Bundled Fields feature allows to bundle all information into one custom field. This custom field is displayed as additional form.

Warning
Before you start, log in as a user with the Jira Administrators global permission.

Note
  • Bundled field feature supports four types of custom fields:
    text fields (single and multi-line), select fields, date pickers and checkboxes.
  • Remember to add the field to the issue screen and to the request type.
  • To check your settings, go to:
    Project Settings > Request Types > Edit fields > Add a field.
Info

For more information on adding a custom field, see official Atlassian documentation.

Add Bundled Field

Steps

To add a bundled field:

  1. Go to Jira Administration > Add-ons.
  2. Select Bundled Fields from the menu in the Extension for Jira Service Management section.
  3. Click Create Custom Field.
    Creating a Bundled Field configuration with Extension for Jira Service Management by adding a custom field
    Creating a Bundled Field configuration with Extension for Jira Service Management by adding a custom field
  4. Click Add custom field.
    The Select a Field Type dialog box appears.
  5. Select Deviniti [Extension] - Bundled Fields from the list in the Advanced section.
  6. Click Next.
    All Deviniti custom fields are branded with the app logo therefore you can find it easy on the list
    All Deviniti custom fields are branded with the app logo therefore you can find it easy on the list
  7. Configure Deviniti [Extension] - Bundled Field’ Field dialog box appears.
  8. Configure the selection criteria (Name and/or Description).
  9. Click Create.
    Now you can type a name and description of bundled fields with Extension for Jira Service Management
    Now you can type a name and description of bundled fields with Extension for Jira Service Management
  10. Select the checkboxes of the screens on which this custom field will be displayed.
  11. Click Update.

Result

A new custom field Deviniti [Extension] - Bundled Fields is added.

Configure Bundled Field

To configure a Bundled Field:

  1. Go to Jira Administration > Add-ons.

  2. Select Bundled Fields from the menu in the Extension for Jira Service Management section.

  3. Select a custom field from the list (below the plus icon) which you want to configure.

    Note
    This list contains all Deviniti [Extension] - Bundled Field custom fields which are added to Jira.

  4. Configure the following:

    • Context: Select in which context of custom field configuration will be set. Each custom field’s context can have own Bundled field’s configuration.
    • Alignment: Select how to compose fields: vertical or horizontal.
  5. Click Add new row.

  6. Configure the following:

    • Field Name: Type name of nested field.
    • Type: Select type of custom field: text, select, checkbox, multi text or date picker.
      Note

      In case of select and checkbox new option is added by clicking New option.

    • Required: Set the state of switch to on to make nested field required.
    • Show Label: Set the state of switch to on to show label of nested field (Field Name).
      Tip
      • Click Copy to copy nested field with configuration and create new rows quicker.
      • Use drag-and-drop to re-order nested fields in the list.
      • Option for deleting configuration is on the right side of the table. Click the trash icon to remove selected fields.
  7. In Layout settings section switch Turn on Edit mode to on.
    Now you can change field’s size and location.

  8. Click Save Layout.

    The next step of creating a Bundled Custom Field configuration with Extension for Jira Service Management is setting a context, number of rows, alignment, field name and type, required and show label option
    Extension for Jira Service Management - Bundled Custom Field configuration screen

Result

A new layout configuration is saved.

Note

If you don’t want to save layout settings, click Discard changes on the right side.

Details

Steps

To configure Bundled Fields details:

  1. Click on Details on the right side.
    Go to configuration details of Bundled Fields with Extension for Jira Service Management
    Go to configuration details of Bundled Fields with Extension for Jira Service Management
  2. Configure the following:
    • Help: Type text which will help user to fill fields.
    • Default number of rows: Choose default number of bundled field rows.
      For example, if you select five rows, a bundled field will be displayed five times, in five rows.
      Note
      You can select maximum 25 rows. If you select 0 as a Default number of rows, your Bundled field will generate as an empty state.
    • Allow user to add new rows during filling the form: Set the state of switch to on to allow user to add new rows during filling the form.
    • Show label only for the first row (in horizontal alignment).
  3. Click Save.
    Configuration details of Bundled Fields with Extension for Jira Service Management
    Configuration details of Bundled Fields with Extension for Jira Service Management

Result

Bundled Fields details are saved.

Example
Show label only for the first row (in horizontal alignment) prevents from repeating field’s labels in case of creating many rows within the issue. If you mark this option as checked, newly created issue will be displayed in the request detail view as in example below.
Example of option: Show label only for the first row (in horizontal alignment) in Bundled Fields with Extension for Jira Service Management
Example of option: Show label only for the first row (in horizontal alignment) in Bundled Fields with Extension for Jira Service Management
Example
If you mark Show label only for the first row (in horizontal alignment) as unchecked, field’s labels will be repeated.
Example of no option: Show label only for the first row (in horizontal alignment) in Bundled Fields with Extension for Jira Service Management
Example of no option: Show label only for the first row (in horizontal alignment) in Bundled Fields with Extension for Jira Service Management

Using Bundled Fields

Steps

To check how bundled fields work:

  1. Go to Jira Administration > Projects.
  2. Select project from the Project list.
    Welcome guide screen is displayed.
  3. Go to Customer channels.
  4. Click Visit the portal or copy and paste a link into a browser address bar.
  5. Create a request.
  6. A screen with the request is displayed.
  7. Fill in the request details, including the custom field: Deviniti [Extension] - Bundled Field (for example: Address).
    Note
    If you allow user to add new rows during filling the form, the + icon appears below the bundled field.
  8. Click Create.
    Creating a request with horizontal alignment in Bundled Fields with Extension for Jira Service Management
    Creating a request with horizontal alignment in Bundled Fields with Extension for Jira Service Management

Result

The request with Deviniti [Extension] - Bundled Field (for example: Address) is created.

Horizontal and vertical alignment

Example

You can configure Bundled fields in horizontal and vertical positions in the request detail view and issue view.
Below you can see the example of Bundled field in horizontal alignment in the request detail view.

Example of request with horizontal alignment in Bundled Fields with Extension for Jira Service Management
Example of request with horizontal alignment in Bundled Fields with Extension for Jira Service Management
Example
The example of Bundled field in vertical alignment in the request detail view.
Example of request with vertical alignment in Bundled Fields with Extension for Jira Service Management
Example of request with vertical alignment in Bundled Fields with Extension for Jira Service Management
Example
Layout settings allows to resize and relocate fields according to your needs. See the example below.
Creating a request with Layout settings in Bundled Fields with Extension for Jira Service Management
Creating a request with Layout settings in Bundled Fields with Extension for Jira Service Management

Bundled Fields Searcher

Extension for Jira Service Management provides a dedicated searcher. It allows to search issues in Jira which contains a Bundled Fields custom field. There are two options: issue in bundledFieldsEx("", "") (two arguments) and issue in bundledFieldsEx("", "", "") (three arguments).

  • issue in bundledFieldsEx("", "")
Syntax with details Example
issue in bundledFieldsEx(“customfield_name”, “subfield_value”) issue in bundledFieldsEx(“Address”, “Poland”)
It returns all issues which contain Address custom field where one value is Poland.
issue in bundledFieldsEx(“Address”, “”) It returns all issues which contain Address custom field where min. one value is empty.
issue in bundledFieldsEx(“customfield_id”, “subfield_value”) issue in bundledFieldsEx(“customfield_10301”, “Poland”)
It returns all issues which contain custom field with ID = 10301 (in this case: Address) where one value is Poland.
issue in bundledFieldsEx(“customfield_10301”, “”)
It returns all issues which contain custom field with ID = 10301 (in this case: Address) where min. one value is empty.
issue in bundledFieldsEx(“id”, “subfield_value”) issue in bundledFieldsEx(“10301”, “Poland”)
It returns all issues which contain custom field with ID = 10301 (in this case: Address) where one value is Poland.
issue in bundledFieldsEx(“10301”, “”)
It returns all issues which contain custom field with ID = 10301 (in this case: Address) where min. one value is empty.
  • issue in bundledFieldsEx("", "", "")
Syntax with details Example
issue in bundledFieldsEx(“customfield_name”, “subfield_name”, “subfield_value”) issue in bundledFieldsEx(“Address”, “Country”, “Poland”)
It returns all issues which contain Address custom field with Country subfield (which value is Poland).
issue in bundledFieldsEx(“customfield_id”, “subfield_name”, “subfield_value”) issue in bundledFieldsEx(“customfield_10301”, “Country”, “Poland”)
It returns all issues which contain custom field with ID = 10301 (in this case: Address) with Country subfield (which value is Poland).
issue in bundledFieldsEx(“id”, “subfield_name”, “subfield_value”) issue in bundledFieldsEx(“10301”, “Country”, “Poland”)
It returns all issues which contain custom field with ID = 10301 (in this case: Address) with Country subfield (which value is Poland).
Tip

To find an ID of Bundled Field custom field, go to the Issues > Custom Fields. Select custom field, click Edit and check URL address.
Example: http://192.168.0.84:8082/secure/admin/EditCustomField!default.jspa?id=10301

Note

If you don’t see issues that contain Bundled Field custom field, go to the Issues > Custom Fields. Select custom field, click Edit and check Search Template. Bundled Fields Searcher should be set.

Bundled Fields
Bundled Fields searcher

Use data from Bundled Fields in Script Runner

This page provides information on using saved data in the Script Runner app for Extension v.6.7.x and earlier.

Note
If you use Extension v.6.8.x. or later, go to this page.

Extension for Jira Service Management app allows to use data from Bundled Fields in the Script Runner, or in the external app.

Note

We’ve tested all methods in this chapter and made sure that they work in the form provided in the examples. The support we provide doesn’t include verifying custom scripts. In case of any issues with customized code we recommend checking out the ScriptRunner documentation, too.

The following .JSON file shows all field types available in Bundled Fields.

{
    "baseGroupId": {
        "fields": [
            { 
                "id": "1a66be6f-b9a6-4bb0-9780-7113f53e4ce6", 
                "name": "text fields", 
                "type": "text", 
                "required": true, 
                "showLabel": true, 
                "options": [], 
                "value": "test" 
            },
            {
                "id": "df42c0c8-0f36-4a6f-b7c9-1030d12e8621",
                "name": "select field",
                "type": "select",
                "required": true,
                "showLabel": true,
                "options": [
                    { "id": "48c432d0-93f2-46c9-959a-b19d56715b8f", "name": "option 1" },
                    { "id": "c891fc2c-2827-437f-81d2-d47ea8da4d29", "name": "option 2" },
                    { "id": "eb9ca7fc-ede1-47c8-9a3c-63823e9e1194", "name": "option 3" }
                ],
                "value": "c891fc2c-2827-437f-81d2-d47ea8da4d29"
            },
            {
                "id": "8655d759-d16a-4d54-b414-bb9391b42c2e",
                "name": "checkbox",
                "type": "checkbox",
                "required": true,
                "showLabel": true,
                "options": [
                    { "id": "1ae64d17-815b-4667-b26d-b1855ead1673", "name": "check 1" },
                    { "id": "ff303f03-f7b7-44fc-81fd-d0329d7deaaa", "name": "check 2" },
                    { "id": "9b2d710d-0505-46b4-b35f-95c1b3d211a3", "name": "check 3" }
                ],
                "value": "1ae64d17-815b-4667-b26d-b1855ead1673,ff303f03-f7b7-44fc-81fd-d0329d7deaaa"
            },
            { 
                "id": "79f1c607-8afe-489a-81f4-a13cba9b499e", 
                "name": "multitext field", 
                "type": "textarea", 
                "required": true, 
                "showLabel": true, 
                "options": [], 
                "value": "test multitext" 
            },
            { 
                "id": "1e1a5b39-c0c8-4426-8b40-33a7a99dacfc", 
                "name": "date field", 
                "type": "date", 
                "required": true, 
                "showLabel": true, 
                "options": [], 
                "value": "2018-11-20" 
            }
        ],
    "id": "baseGroupId"
    }
}

Get Bundled Field’s value

Variable (String) Description Example
issueKey Key of issue where bundled field is placed WORK-27
bundledFieldId ID of source bundled field customfield_10300
fieldName Name of the field in column in bundled field select field
Integer row Number of row in bundled field 0
Note
Rows numbering starts from 0.

The following example shows how to get Bundled Field’s value.

import com.atlassian.jira.component.ComponentAccessor
import groovy.json.JsonSlurper
import org.apache.log4j.Logger
import org.apache.log4j.Level

def log = Logger.getLogger("com.onresolve.scriptrunner.runner.ScriptRunnerImpl")
log.setLevel(Level.DEBUG)

//key of issue, where the bundledfields value is
String issueKey = 'WORK-27'
//id of bundledfield where we are looking for value
String bundledFieldId= "customfield_10300" 
//field column in bundledfield
String fieldName = "select field"
//row in bundledfield
Integer row = 0 

def issueManager = ComponentAccessor.getIssueManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cfBundledFields = customFieldManager.getCustomFieldObject(bundledFieldId)
def issue = issueManager.getIssueObject(issueKey)

String cfValue = issue.getCustomFieldValue(cfBundledFields)
Object jsonValue = new JsonSlurper().parseText(cfValue)

////Retrieve a value of requested row and field name
List fields = getFieldsForRow(row,(Map) jsonValue)
Map field = getFieldByName(fieldName,fields)
def value = getFieldValue(field)
log.info("my subField ${fieldName} value is ${value}")
value

def String getFieldValue(Map field){
    def type = field.type
    if(type == 'select' || type == 'checkbox'){
        return getOptionValue(field)
    }
    return field.value
}

def String getOptionValue(Map field) {
    List<Map> allOptions = (List<Map>) field.options
    String val = field.value
    String[] selectedIds = val.split(',')
    List<Map> selectedOptions = allOptions.findAll { it.id in selectedIds }
    return selectedOptions.name.join(', ')
}

def Map getFieldByName(fieldName, List<Map> fields){
    return fields.find{it.name == fieldName}
}

def List getFieldsForRow(row,Map json){
    List fields = null
    int i=0
    json.each{k,v -> 
        if(i == row){
            fields = ((Map) v).get("fields")
        }
        i++
    }
    return fields
} 

Copy Bundled Field’s value

Variable (String) Description Example
issueFromKey Key of issue from which field’s value will be copied WORK-27
issueToKey Key of issue to which field’s value will be copied WORK-28
cfFromId ID of source custom field customfield_10300
cfToId ID of target custom field customfield_10403

The following example shows how to copy Bundled Field’s value to another field with the same configuration.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.issue.ModifiedValue

String issueFromKey = 'WORK-27'
String issueToKey = 'WORK-28'
String cfFromId = "customfield_10300" //bundledfield id copy from
String cfToId = "customfield_10403" //bundledfield id copy to(copy to field must have the same configuration)

def issueManager = ComponentAccessor.getIssueManager()
def issueFrom = issueManager.getIssueObject(issueFromKey)
def issueTo = issueManager.getIssueObject(issueToKey)

def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cfFrom = customFieldManager.getCustomFieldObject(cfFromId)
def cfTo = customFieldManager.getCustomFieldObject(cfToId)

def cfValueFrom = issueFrom.getCustomFieldValue(cfFrom)
def cfValueTo = issueTo.getCustomFieldValue(cfTo)

if (cfFrom && cfTo) {
    def changeHolder = new DefaultIssueChangeHolder()
    cfTo.updateValue(null, issueTo, new ModifiedValue(cfValueTo, cfValueFrom),changeHolder)
}

issueTo.getCustomFieldValue(cfTo) != null

Need help?

If you can’t find the answer you need in our documentation, raise a support request*.

  • Include as much information as possible to help our support team resolve your issue faster.

Additional reading