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

JIRA transition Resolution field in Stash does not work for other languages

    XMLWordPrintable

Details

    Description

      Steps to reproduce

      1. Create Application Link between JIRA and Stash
      2. Enable HTTP Access dump logging at JIRA Administration >> System >> Logging & Profiling >> HTTP Access Logging
      3. Set JIRA server Default Language to be "Deutsch (Deutschland)" at JIRA Administration >> System >> General Configuration
      4. From Stash Repository Commit page, click on a JIRA Issue key
      5. From the popup window, Resolved the issue by clicking on the transition "Vorgang lösen"
      6. Choose the option "Behoben" (Fixed) for the field "Lösung" (Resolution)
      7. Click on the button "Vorgang lösen" to transition it
        It failed with the error: Lösungsname "Behoben" ist ungültig (Resolution name "Behoben" is invalid)

      error in Stash log:

      2015-01-29 22:26:16,706 ERROR [http-nio-7990-exec-4] kahloun.foong @6AZEK7x1346x200x0 1qssin 0:0:0:0:0:0:0:1 "POST /rest/jira-integration/latest/issues/TST-1/transitions HTTP/1.1" c.a.i.i.jira.DefaultJiraService TST-1 could not be transitioned: JiraErrors{errorMessages=[], errors={resolution=Lösungsname "Behoben" ist ungültig}}
      

      JIRA server atlassian-jira-http-dump.log show that Stash is performing the POST request by using the resolution name "Behoben":

      127.0.0.1 o1349x969x1 kahloun.foong [29/Jan/2015:22:29:10 +0800] "POST http://localhost:8631/rest/api/2/issue/TST-1/transitions HTTP/1.1" 400 85 0.0350 - "Jakarta Commons-HttpClient/3.1" "1xbaicc"
      	___ Request _____________________________________________________
      	Request HTTP Headers : 
      		authorization=OAuth oauth_token="dqqpgO9tpLMMK2B06IFEQRrPUqqUBFON", oauth_consumer_key="Stash%3A3679987520", oauth_signature_method="RSA-SHA1", oauth_timestamp="1422541750", oauth_nonce="1422541750379400000", oauth_version="1.0", oauth_signature="mvcbUW8%2FVr19H%2BSxRNzrN4kKULne%2FcI%2BxreyXD6rM5KaI%2FtJ%2Bu371Ro8OGQLxwu3%2Fj3X7PivGQJ04gbo2PAOseh7Eg3mciJ1pZ7ZY3PGwvm6g%2B2bzOpAvLnz6BjCFZU2%2Fe53Ww7HCBhval5ok986F66yxdAPI6Vf4tjQAh%2BRgt4%3D"
      		connection=close
      		user-agent=Jakarta Commons-HttpClient/3.1
      		host=localhost:8631
      		content-length=104
      		content-type=application/json; charset=UTF-8
      	Request Attributes : 
      		com.atlassian.jira.web.filters.JiraPostEncodingFilter_alreadyfiltered=true
      		os_securityfilter_already_filtered=true
      		com.atlassian.seraph.auth.LoginReason=OK
      		com.newrelic.agent.TRANSACTION_NAME=/rest/api/*
      		jira.request.id=1349x969x1
      		jira.webwork.cleanup=false
      		atlassian.core.seraph.original.url=/rest/api/2/issue/TST-1/transitions
      		com.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFixupFilter=true
      		com.atlassian.oath.request-flag=true
      		com.atlassian.labs.botkiller.BotKillerFilter=true
      		com.atlassian.jira.web.filters.JiraFirstFilter_alreadyfiltered=true
      		com.atlassian.jira.web.filters.JiraDecoratingFilter_alreadyfiltered=true
      		com.atlassian.gzipfilter.GzipFilter_already_filtered=true
      		jira.request.start.millis=1422541750386
      		loginfilter.already.filtered=true
      		com.atlassian.johnson.filters.Johnson503Filter_already_filtered=true
      		com.atlassian.jira.web.filters.accesslog.AccessLogFilter_already_filtered=true
      		jira.request.username=kahloun.foong
      		jira.request.assession.id=1xbaicc
      		com.atlassian.oath.consumer-key=Stash:3679987520
      		os_authstatus=success
      		com.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFilter=true
      		jira.xsrf.set.cookie.pending=BGGW-YCEG-2SBO-7GZP|95b9d8cefdd749c356aa521b54eafa8b32b63e3d|lin
      		com.atlassian.jira.security.xsrf.XsrfTokenAdditionRequestFilter_already_filtered=true
      		os_authTypeDefault=any
      		page.builder=com.atlassian.jira.web.pagebuilder.DefaultPageBuilder@dbc2c96
      	Request Data (total 104 bytes) : 
      
      {"fields":{"assignee":{"name":"kahloun.foong"},"resolution":{"name":"Behoben"}},"transition":{"id":"5"}}	___ Response ____________________________________________________
      	Response HTTP Headers : 
      		X-AUSERNAME=kahloun.foong
      		Cache-Control=no-cache, no-store, no-transform
      		Content-Type=application/json
      		X-Content-Type-Options=nosniff
      	Response Data (total 85 bytes) : 
      
      {"errorMessages":[],"errors":{"resolution":"Lösungsname \"Behoben\" ist ungültig"}}
      

      performing the same POST request with curl command will have the same error:

      Foongs-MacBook-Pro-2:Downloads foong$ echo "{\"fields\":{\"assignee\":{\"name\":\"kahloun.foong\"},\"resolution\":{\"name\":\"Behoben\"}},\"transition\":{\"id\":\"5\"}}" > data.txt
      Foongs-MacBook-Pro-2:Downloads foong$ curl -u admin:admin -X POST -H "Content-Type: application/json" -d @data.txt  http://localhost:8631/rest/api/2/issue/TST-1/transitions 
      {"errorMessages":[],"errors":{"resolution":"Lösungsname \"Behoben\" ist ungültig"}}
      

      Stash should use Resolution ID for this POST request instead of Resolution Name:

      Foongs-MacBook-Pro-2:Downloads foong$ echo "{\"fields\":{\"assignee\":{\"name\":\"kahloun.foong\"},\"resolution\":{\"id\":\"1\"}},\"transition\":{\"id\":\"5\"}}" > data.txt
      Foongs-MacBook-Pro-2:Downloads foong$ curl -u admin:admin -X POST -H "Content-Type: application/json" -d @data.txt  http://localhost:8631/rest/api/2/issue/TST-1/transitions 
      

      Attachments

        Issue Links

          Activity

            People

              dpenkin@atlassian.com Daniil Penkin
              klfoong Foong (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: