This section provides information on configuring Bundled Fields.
A Bundled Fields feature allows to bundle all information into one custom field. This custom field is displayed as additional form. This feature supports the following types of custom fields:
For more information on adding a custom field, see official Atlassian documentation.
To add a bundled field:
Global permission. A new custom field Deviniti [Extension] - Bundled Fields is added.
To configure a Bundled Field custom field:
Go to Jira Administration > Manage apps.
Select Bundled Fields from the menu in the Extension for Jira Service Management section.
Select a custom field with its context which you want to configure.
The list contains all Deviniti [Extension] - Bundled Fields custom fields which are added to Jira.
Layout on the Issue View screen: Select how to compose fields: Horizontal, Vertical or Custom.
Click Add new sub-fields.
Configure the following:
a. Sub-field name: Type name of nested field.
b. Type: Select type of sub-field: Checkboxes, Date Picker, Date Time Picker, Time Picker, Text Field (single line), Text Field (multi-line), Select List (single choice), User Picker (single user).
For Checkboxes and Select List (single choice), new option can be added by clicking:
For Text Field (single line), you can define the formatting and validators. Read more here.
In Layout settings section switch Turn on Edit mode to on.
Now you can change field’s size and location.
Click Save Layout.
Bundled Field has been configured.
To configure Bundled Field’s details:
Bundled Field’s details have been configured.
This option allows you to copy configuration from source custom field to the target field. Source custom field can be a Bundled Field from Dynamic Forms for Jira app and Extension for Jira Service Management app.
To import configuration:
Bundled Field has a configuration from imported custom field.
You can define the formatting and validators for Text fields. By default, the None option is selected.
Click More > Format and validation.
Select option which you want to set.
Currency
Number | Format | String |
---|---|---|
1000.234 | $0,0.00, | $1,000.23 |
1000.2, | $0,0[.]00 | $,1,000.20 |
1001, | $ 0,0[.]00, | $ 1,001 |
100.55 | 0.0 PLN, | 100.6 PLN |
Percentages
Number | Format | String |
---|---|---|
1 | 0% | 100% |
0.974878234 | 0.000% | 97.488% |
-0.43 | 0 % | -43 % |
1 | 0 | 1% |
0.64 | 0.00 | 0.64% |
Number
Number | Format | String |
---|---|---|
10000 | 0,0.0000 | 10,000.0000 |
10000.23 | 0,0 | 10,000 |
10000.1234 | 0.000 | 10000.123 |
100.1234 | 00000 | 00100 |
1000.1234 | 000000,0 | 001,000 |
10 | 000.00 | 010.00 |
10000.1234 | 0[.]00000 | 10000.12340 |
-10000 | (0,0.0000) | (10,000.0000) |
To define formatting, you can also select locales from the list in the Advanced section. This list contains all languages supported by numeral.js. English (United States) [en] is set by default.
If the value entered on the form does not match the format, the user will see a warning and the creation of the request will be blocked until he enters the correct value.
Select RegExp option if you want to use Regex. Regular Expressions aka Regex are expressions that define a search pattern. They are widely used for validation purposes, like email validation, url validation, phone number validation and so on.
Commonly used regex
Alphanumeric Characters
^[a-zA-Z0-9]*$
^[a-zA-Z0-9 ]*$
^([a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6})*$
^([a-z0-9_\.\+-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$
Password Strength
(?=(.*[0-9]))((?=.*[A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z]))^.{8,}$
URL
https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*)
(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)
Phone Number
^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9]*$
Credit Card Numbers
^3[47][0-9]{13}$
^3(?:0[0-5]|[68][0-9])[0-9]{11}$
^(?:2131|1800|35\d{3})\d{11}$
^9[0-9]{15}$
^(5018|5020|5038|6304|6759|6761|6763)[0-9]{8,15}$
^5[1-5][0-9]{14}$
^(62[0-9]{14,17})$
^4[0-9]{12}(?:[0-9]{3})?$
^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14})$
Select Mask option if you want to help the user to provide data in a specific format (such as credit card number, zip code, phone number). Default format characters are:
For example:
99999-9999
+4\9 99 999 99
Put your example to Test input to check if it works correctly. The result will be shown in the last column.
Click Save.
A configuration for Text field is set.
To check how bundled fields work:
The request with Deviniti [Extension] - Bundled Field (for example: Tools for new team) is created.
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 sub-field (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 sub-field (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 sub-field (which value is Poland). |
You can also search using parameters.
Parameter | Example |
---|---|
NOT_EMPTY (search by sub-fields which are not empty) | issue in bundledFieldsEx(“Bundled Field 1 (DF)”, “Last name”, “NOT_EMPTY”) |
IN (search by sub-fields which contain selected values) | issue in bundledFieldsEx(“Bundled Field 1 (DF)”, “Select field”, “IN”, “One”, “Two”) |
NOT_IN (search by sub-fields which don’t contain selected values) | issue in bundledFieldsEx(“Bundled Field 1 (DF)”, “Select field”, “NOT_IN”, “One”, “Two”) |
You can also search by Date and Date Time sub-fields. Use the following patterns:
Operator | Example |
---|---|
< | issue in bundledFieldsEx(“Bundled Field 1 (DF)”, “Date”,"<",“2019-04-30”) |
issue in bundledFieldsEx(“Bundled Field 1 (DF)”, “Date Time”,"<",“2019-04-30 10:01 am”) | |
issue in bundledFieldsEx(“Bundled Field 1 (DF)”, “Time”,"<",“08:15 am”) | |
> | issue in bundledFieldsEx(“Bundled Field 1 (DF)”, “Date”,">",“2019-04-29”) |
issue in bundledFieldsEx(“Bundled Field 1 (DF)”, “Date Time”,">",“2019-04-30 09:55 am”) | |
issue in bundledFieldsEx(“Bundled Field 1 (DF)”, “Time”,">",“08:15 am”) | |
BETWEEN | issue in bundledFieldsEx(“Bundled Field 1 (DF)”, “Date”,“BETWEEN”,“2019-04-29”,“2019-04-31”) |
issue in bundledFieldsEx(“Bundled Field 1 (DF)”, “Date Time”,“BETWEEN”,“2019-04-30 09:50 am”,“2019-04-30 10:10 am”) | |
issue in bundledFieldsEx(“Bundled Field 1 (DF)”, “Time”,“BETWEEN”,“08:13 am”,“08:15 am”) |
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
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.
This page provides information on using saved data in the Script Runner app.
Extension for Jira Service Management app allows to use data from Bundled Fields in the Script Runner, or in the external app.
The following .JSON file shows sub-fields which are Text Fields with formatting.
{
"baseGroupId": {
"fields": [
{
"id": "498dd485-5c01-4c08-a96e-9835b0f9e557",
"originId": "498dd485-5c01-4c08-a96e-9835b0f9e557",
"name": "Currency",
"type": "text",
"required": false,
"options": [],
"showLabel": true,
"format": "0,000",
"formatType": "CURRENCY",
"locale": "pl",
"selectableType": false,
"isValid": true,
"valuePreview": "123",
"value": "123",
"validationMessage": "Provide a number. Field will be formatted by 0,000"
},
{
"id": "89d54237-7d5a-49d0-beb5-14448a80ee3a",
"originId": "89d54237-7d5a-49d0-beb5-14448a80ee3a",
"name": "Percent",
"type": "text",
"required": false,
"options": [],
"showLabel": true,
"format": "0.000",
"formatType": "PERCENT",
"selectableType": false,
"isValid": true,
"valuePreview": "23.000%",
"value": "23",
"validationMessage": "Provide a number. Field will be formatted by 0.000"
},
{
"id": "13c3f2ff-e672-42bf-baf4-6e3d862144a2",
"originId": "13c3f2ff-e672-42bf-baf4-6e3d862144a2",
"name": "Number",
"type": "text",
"required": false,
"options": [],
"showLabel": true,
"format": "0.000",
"formatType": "NUMBER",
"selectableType": false,
"isValid": true,
"valuePreview": "555.330",
"value": "555.33",
"validationMessage": "Provide a number. Field will be formatted by 0.000"
},
{
"id": "1133b666-b824-4d92-94ea-3e2eb371a2c4",
"originId": "1133b666-b824-4d92-94ea-3e2eb371a2c4",
"name": "Mail regex",
"type": "text",
"required": false,
"options": [],
"showLabel": true,
"format": "^[0-9a-zA-Z_.-]+@[0-9a-zA-Z.-]+\\.[a-zA-Z]{2,3}$",
"formatType": "REGEXP",
"selectableType": false,
"isValid": true,
"valuePreview": "asdf@gmail.com",
"value": "asdf@gmail.com",
"validationMessage": "Provide a value, which will match with regular expression ^[0-9a-zA-Z_.-]+@[0-9a-zA-Z.-]+\\.[a-zA-Z]{2,3}$"
},
{
"id": "9f5696e9-8177-4871-9aad-f97511c1a2bd",
"originId": "9f5696e9-8177-4871-9aad-f97511c1a2bd",
"name": "Phone mask",
"type": "text",
"required": false,
"options": [],
"showLabel": true,
"format": "(999) 999-9999",
"formatType": "MASK",
"selectableType": false,
"isValid": true,
"valuePreview": "(555) 533-4353",
"value": "(555) 533-4353",
"validationMessage": "Provide a value, that matches the mask (999) 999-9999"
}
]
}
}
The following .JSON file shows the rest types available in Bundled Fields (Text Field without formatting, Select, Date, User).
{
"baseGroupId": {
"fields": [
{
"id": "dec73b72-fc00-499e-8096-a15a07d3a73f",
"originId": "dec73b72-fc00-499e-8096-a15a07d3a73f",
"name": "Text",
"type": "text",
"required": false,
"options": [],
"showLabel": true,
"selectableType": false,
"isValid": true,
"valuePreview": "Random text 2",
"value": "Random text 2"
},
{
"id": "be3bc369-7e4a-4c61-a2cd-b187c2b22e2f",
"originId": "be3bc369-7e4a-4c61-a2cd-b187c2b22e2f",
"name": "Select",
"type": "select",
"required": false,
"options": [
{
"id": "31df54a1-902f-485b-ac76-13f14c26dc8e",
"name": "1",
"order": 0
},
{
"id": "7abfae20-720a-4f06-9e88-d30f31367ae0",
"name": "2",
"order": 1
}
],
"showLabel": true,
"selectableType": true,
"isValid": true,
"valuePreview": "7abfae20-720a-4f06-9e88-d30f31367ae0",
"value": "7abfae20-720a-4f06-9e88-d30f31367ae0"
},
{
"id": "d4067c44-63ce-4362-b486-8e90efffe035",
"originId": "d4067c44-63ce-4362-b486-8e90efffe035",
"name": "Date time",
"type": "datetime",
"required": false,
"options": [],
"showLabel": true,
"selectableType": false,
"isValid": true,
"valuePreview": "2019-11-21T08:00:00.000Z",
"value": "2019-11-21T08:00:00.000Z"
},
{
"id": "113c288f-c269-4558-93c6-01ebc1fbfd64",
"originId": "113c288f-c269-4558-93c6-01ebc1fbfd64",
"name": "User",
"type": "user",
"required": false,
"options": [],
"showLabel": true,
"selectableType": false,
"isValid": true,
"valuePreview": "abu tulk",
"value": "abu tulk"
}
]
}
}
{
"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"
}
}
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 |
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
}
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
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.