Define Parameters


To define parameters for your job, select the This project is parameterized check box.

The Add Parameter drop-down is enabled with the list of parameter types. Use the drop-down button to add as many parameters as you need.



There are different parameter types available. The way parameters take effect according their respective parameter type.

For example,

String Parameter are selected, and corresponding parameters are added as shown below.



The above parameters will be parsed dynamically at the run time.

The field values should be entered in the following syntax:

${ParameterName}

For example,

For the parameters created above, the field value would be ${API} and ${TestRunName} respectively. The parameter values will be parsed accordingly for the corresponding fields.



The values can also be changed before triggering the Jenkins build.




JIRA Fields

i) How to get Custom Field ID?

Rest call to JIRA to get all JIRA fields.

The following URL gives all custom fields get ID for selected custom fields that you want to apply.

<Jira_Base_URL>/rest/api/2/field 


ii) Base format for custom fields.

[
{
"testRun": [
{
}
]
},
{
"testScenario": [
{
}
]
},
{
"testCase": [
{
}
]
}
]


iii) Standard Custom Field Types

The following types are for reference only, other types of Custom Field Types are also supported.


Custom Field TypeValidation RuleExample
CheckboxesThe checkbox accepts comma separated multiple values{
  "customfield_10200": [
    {
      "value": "true"
    },
    {
      "value": "false"
    }
  ]
}
Date PickerThe Date picker accepts only specified format Date{
  "customfield_10202":"2017-09-06"
}
Date Time PickerThe Date time picker accepts only specified format Date and time{
  "customfield_10203": "2013-03-01T00:00:00.000+0400"
}
Number FieldThe Number field accepts any number with decimal{
  "customfield_10205": 2876784
}
Radio ButtonsThe radio button accepts single value from JIRA fields{
  "customfield_10206": {
    "value": "option1"
  }
}
Select List (multiple choices)The Select List Multiple accepts comma separated multiple values{
  "customfield_10208": [
    {
      "value": "Select List Multiple 1"
    },
    {
      "value": "Select List Multiple 2"
    }
  ]
}
Select List (single choice)The radio button accepts single value from JIRA fields{
  "customfield_10209": {
    "value": "Select List single 1"
  }
}
Text Field (multi-line)It accepts text in multiple lines{
  "customfield_10210": "this is sample.\nexample"
}
Text Field (single line)It accepts text in single line{
  "customfield_10211": "this is sample.example"
}
URL FieldIt accepts Web URL{
  "customfield_10212": "http://www.url-encode-decode.com/"
}
User Picker (single user)The User field accepts only available JIRA users{
  "customfield_10213": {
    "name": "admin"
  }


iv) JSON Example

If you want to set 2 custom fields (checkbox, single text) on test run issue type and one custom fields (Radio Button) on scenario and test case level.

"JIRAFields":
[
  {
    "testRun": [
      {
        "customfield_10200": [
          {
            "value""true"
          },
          {
            "value""false"
          }
        ]
      },
      {
        "customfield_10211""this is sample.example"
      }
    ]
  },
  {
    "testScenario": [
      {
        "customfield_10206": {
          "value""option1"
        }
      }
    ]
  },
  {
    "testCase": [
      {
        "customfield_10206": {
          "value""option1"
        }
      }
    ]
  }
]