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 Type
Validation Rule
Example
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"
        }
      }
    ]
  }
]


Go to Main Page


Attachments:

Build with Parameters.png (image/png)
Post Build Action.png (image/png)
Parameters Added.png (image/png)
Parameterized checkbox.png (image/png)
QTMtestExe Screen.png (image/png)
Pipleline Console.png (image/png)
Adv Project Options.png (image/png)
Build Triggers.png (image/png)
General.png (image/png)
Enter Item name.png (image/png)
Pipeline Script.png (image/png)
New item.png (image/png)
vstestconfig6.png (image/png)
Add vstestconfig6a.png (image/png)
vstestexe5.png (image/png)
Server Freestyle config.png (image/png)
Cloud Freestyle config.png (image/png)
msbuildconfig4.png (image/png)
Add msbuildconfig4a.png (image/png)
msbuildExecutable3.png (image/png)
script2.png (image/png)
git config-1.png (image/png)
Config Freestyle Server.png (image/png)
Config Freestyle Cloud.png (image/png)
Server ScreenShot.jpg (image/jpeg)
Cloud ScreenShot.jpg (image/jpeg)
Test Result.png (image/png)
Success.png (image/png)
SCM.png (image/png)
Post Build actions.png (image/png)
Post Build action menu.png (image/png)
Post Build action Cloud2.png (image/png)
Post Build action Cloud.png (image/png)
Item Name.png (image/png)
Git.png (image/png)
Build.png (image/png)
Add build step.png (image/png)