Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-9285

Dropdown field from JIRA doesn't show "None" option

    XMLWordPrintable

Details

    Description

      Summary

      When trying to transition a JIRA issue from within Bitbucket Server, when loading dropdown fields from JIRA, Bitbucket Server doesn't offer the option "None", present in JIRA for the given field. "None" is a value generated by JIRA to allow a user not to choose a value for the given field. Bitbucket Server only displays the actual possible values for the field, so it comes with the first option available selected, and it's not possible to set it to "None".

      Environment

      • Verified occurrence with:
        • JIRA 6.4.6 and 7.2.1
        • Bitbucket Server 4.3.2, 4.8.3 and 4.10.1
      • Configuration in JIRA:
        • Have a custom field with some values to be selected (e.g. Option 1; Option 2; and Option 3)
        • Configure the given transition to include a screen (e.g. transition to "Done" including a "Resolve Issue screen")
        • Make sure the "Resolve Issue screen" includes the custom field previously created
      • Have an Application Link created between Bitbucket Server and JIRA
      • Create a commit that links to a JIRA issue

      Steps to Reproduce

      1. Go to your commits list in Bitbucket Server and click on the linked JIRA issue.
      2. Click to transition the issue to the "Done" status.

      Expected Results

      • Considering no value was set for the custom field previously configured, its value should be set as "None".

      Actual Results

      • The custom field doesn't present the "None" value, having the first possible value selected instead.
      • It's not possible to select "None" as this value isn't present.
      • You can check that, in JIRA, when trying to perform the same transition, the custom field has its value set to "None".

      Notes

      • When performing the transition in JIRA, the application does a request to CommentAssignIssue. As can be seen in a JIRA HTTP dump log, for the request:
        0:0:0:0:0:0:0:1 i903x1618x1 grefosco [31/Oct/2016:15:03:10 -0200] "GET http://localhost:8080/jira/secure/CommentAssignIssue!default.jspa HTTP/1.1" - - - "http://localhost:8080/jira/browse/JRA-1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0" "4an34n"
        0:0:0:0:0:0:0:1 o903x1618x1 grefosco [31/Oct/2016:15:03:10 -0200] "GET http://localhost:8080/jira/secure/CommentAssignIssue!default.jspa HTTP/1.1" 200 15057 0.0370 "http://localhost:8080/jira/browse/JRA-1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0" "4an34n"
        

        JIRA creates an additional value for the field, besides the possible values, which has the value "None":

            			                                                <div class="field-group" >
            			                                                                        <label for="customfield_10100">Documentation Status</label>
            			                <select class="select cf-select" name="customfield_10100" id="customfield_10100">
            			            <option value="-1">None</option>
            			                            <option value="10102">Option 2</option>
            			                                <option value="10101">To be adapted</option>
            			                                <option value="10103">Option 3</option>
            			            </select>
            			                                    </div>
        
      • When transitioning from Bitbucket Server, a call to the following REST API endpoint is done:
        http://localhost:8080/jira/rest/api/2/issue/JRA-1/transitions?expand=transitions.fields
        

        Which retrieves only the possible values for the custom field, and Bitbucket Server doesn't include a "None" value:

        {
        	"expand": "transitions",
        	"transitions": [{
        		"id": "11",
        		"name": "To Do",
        		"to": {
        			"self": "http://localhost:8080/jira/rest/api/2/status/10000",
        			"description": "",
        			"iconUrl": "http://localhost:8080/jira/",
        			"name": "To Do",
        			"id": "10000",
        			"statusCategory": {
        				"self": "http://localhost:8080/jira/rest/api/2/statuscategory/2",
        				"id": 2,
        				"key": "new",
        				"colorName": "blue-gray",
        				"name": "To Do"
        			}
        		},
        		"fields": {}
        	}, {
        		"id": "21",
        		"name": "In Progress",
        		"to": {
        			"self": "http://localhost:8080/jira/rest/api/2/status/3",
        			"description": "This issue is being actively worked on at the moment by the assignee.",
        			"iconUrl": "http://localhost:8080/jira/images/icons/statuses/inprogress.png",
        			"name": "In Progress",
        			"id": "3",
        			"statusCategory": {
        				"self": "http://localhost:8080/jira/rest/api/2/statuscategory/4",
        				"id": 4,
        				"key": "indeterminate",
        				"colorName": "yellow",
        				"name": "In Progress"
        			}
        		},
        		"fields": {}
        	}, {
        		"id": "31",
        		"name": "In Review",
        		"to": {
        			"self": "http://localhost:8080/jira/rest/api/2/status/10001",
        			"description": "",
        			"iconUrl": "http://localhost:8080/jira/",
        			"name": "In Review",
        			"id": "10001",
        			"statusCategory": {
        				"self": "http://localhost:8080/jira/rest/api/2/statuscategory/4",
        				"id": 4,
        				"key": "indeterminate",
        				"colorName": "yellow",
        				"name": "In Progress"
        			}
        		},
        		"fields": {}
        	}, {
        		"id": "41",
        		"name": "Done",
        		"to": {
        			"self": "http://localhost:8080/jira/rest/api/2/status/10002",
        			"description": "",
        			"iconUrl": "http://localhost:8080/jira/",
        			"name": "Done",
        			"id": "10002",
        			"statusCategory": {
        				"self": "http://localhost:8080/jira/rest/api/2/statuscategory/3",
        				"id": 3,
        				"key": "done",
        				"colorName": "green",
        				"name": "Done"
        			}
        		},
        		"fields": {
        			"fixVersions": {
        				"required": false,
        				"schema": {
        					"type": "array",
        					"items": "version",
        					"system": "fixVersions"
        				},
        				"name": "Fix Version/s",
        				"operations": ["set", "add", "remove"],
        				"allowedValues": []
        			},
        			"worklog": {
        				"required": false,
        				"schema": {
        					"type": "array",
        					"items": "worklog",
        					"system": "worklog"
        				},
        				"name": "Log Work",
        				"operations": ["add"]
        			},
        			"assignee": {
        				"required": false,
        				"schema": {
        					"type": "user",
        					"system": "assignee"
        				},
        				"name": "Assignee",
        				"autoCompleteUrl": "http://localhost:8080/jira/rest/api/latest/user/assignable/search?issueKey=JRA-1&username=",
        				"operations": ["set"]
        			},
        			"customfield_10100": {
        				"required": false,
        				"schema": {
        					"type": "option",
        					"custom": "com.atlassian.jira.plugin.system.customfieldtypes:select",
        					"customId": 10100
        				},
        				"name": "Documentation Status",
        				"operations": ["set"],
        				"allowedValues": [{
        					"self": "http://localhost:8080/jira/rest/api/2/customFieldOption/10102",
        					"value": "Option 2",
        					"id": "10102"
        				}, {
        					"self": "http://localhost:8080/jira/rest/api/2/customFieldOption/10101",
        					"value": "To be adapted",
        					"id": "10101"
        				}, {
        					"self": "http://localhost:8080/jira/rest/api/2/customFieldOption/10103",
        					"value": "Option 3",
        					"id": "10103"
        				}]
        			},
        			"resolution": {
        				"required": true,
        				"schema": {
        					"type": "resolution",
        					"system": "resolution"
        				},
        				"name": "Resolution",
        				"operations": ["set"],
        				"allowedValues": [{
        					"self": "http://localhost:8080/jira/rest/api/2/resolution/10000",
        					"name": "Done",
        					"id": "10000"
        				}, {
        					"self": "http://localhost:8080/jira/rest/api/2/resolution/10001",
        					"name": "Won't Do",
        					"id": "10001"
        				}, {
        					"self": "http://localhost:8080/jira/rest/api/2/resolution/10002",
        					"name": "Duplicate",
        					"id": "10002"
        				}, {
        					"self": "http://localhost:8080/jira/rest/api/2/resolution/10003",
        					"name": "Cannot Reproduce",
        					"id": "10003"
        				}]
        			}
        		}
        	}]
        }
        

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              grefosco Gustavo Refosco (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: