Uploaded image for project: 'Jira Cloud'
  1. Jira Cloud
  2. JRACLOUD-81320

Add Worklog REST api does not return correct error message and code.

    XMLWordPrintable

Details

    Description

      Issue Summary

      We have REST api to add worklog which allows one to add worklog properties : https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-worklogs/#api-rest-api-3-issue-issueidorkey-worklog-post
      However when we pass properties in the json in an incorrect format it throws 500 error instead of 400.

      Steps to Reproduce

      1. Call the Add worklog API with the following request json
      {
        "started": "2023-06-12T08:00:02.000+0000",
        "timeSpentSeconds": 3600,
        "properties": [
          {
            "key": "account",
            "value": "a"
          }
        ]
      }
      

      Expected Results

      It show throw 400 error message along with expected JSON format which is as below

      {
        "key": "issue.support",
        "value": {
          "system.conversation.id": "b1bf38be-5e94-4b40-a3b8-9278735ee1e6",
          "system.support.time": "1m"
        }
      }
      

      Actual Results

      It throws 500 error currently.

      Workaround

      The correct format to pass properties in add worklog api is as below

      {
        "key": "issue.support",
        "value": {
          "system.conversation.id": "b1bf38be-5e94-4b40-a3b8-9278735ee1e6",
          "system.support.time": "1m"
        }
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            vujjannavar@atlassian.com Vijay U
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: