ctreminiom / go-atlassian

✨ Golang Client Library for Atlassian Cloud.
https://docs.go-atlassian.io
MIT License
114 stars 29 forks source link

Support customfield_10010 aka request type #262

Open Fank opened 3 weeks ago

Fank commented 3 weeks ago

Is your feature request related to a problem? Please describe. By using the service desk from atlassian a customfield customfield_10010 will be used.

Describe the solution you'd like Add a parse customfield function.

Describe alternatives you've considered none

Additional context example json:

   "customfield_10010":{
      "_links":{
         "jiraRest":"https://asd-sandbox-999.atlassian.net/rest/api/2/issue/46641",
         "web":"https://asd-sandbox-999.atlassian.net/servicedesk/customer/portal/2/ASD-3974",
         "self":"https://asd-sandbox-999.atlassian.net/rest/servicedeskapi/request/46641",
         "agent":"https://asd-sandbox-999.atlassian.net/browse/ASD-3974"
      },
      "requestType":{
         "_expands":[
            "field"
         ],
         "id":"72",
         "_links":{
            "self":"https://asd-sandbox-999.atlassian.net/rest/servicedeskapi/servicedesk/2/requesttype/72"
         },
         "name":"Sales Order Service Ticket",
         "description":"",
         "helpText":"",
         "issueTypeId":"10039",
         "serviceDeskId":"2",
         "portalId":"2",
         "groupIds":[

         ],
         "icon":{
            "id":"10550",
            "_links":{
               "iconUrls":{
                  "48x48":"https://asd-sandbox-999.atlassian.net/rest/api/3/universal_avatar/view/type/SD_REQTYPE/avatar/10550?size=large",
                  "24x24":"https://asd-sandbox-999.atlassian.net/rest/api/3/universal_avatar/view/type/SD_REQTYPE/avatar/10550?size=small",
                  "16x16":"https://asd-sandbox-999.atlassian.net/rest/api/3/universal_avatar/view/type/SD_REQTYPE/avatar/10550?size=xsmall",
                  "32x32":"https://asd-sandbox-999.atlassian.net/rest/api/3/universal_avatar/view/type/SD_REQTYPE/avatar/10550?size=medium"
               }
            }
         }
      },
      "currentStatus":{
         "status":"Work in progress",
         "statusCategory":"INDETERMINATE",
         "statusDate":{
            "iso8601":"2024-01-31T01:00:22+0900",
            "jira":"2024-01-30T17:00:22.539+0100",
            "friendly":"31.01.2024 01:00",
            "epochMillis":1706630422539
         }
      }
   }
ctreminiom commented 1 week ago

Hey @Fank,

Fank commented 1 week ago

Hey @ctreminiom,

This is exactly why I posted an example JSON, because I was not able to find any schema of customfield_10010 . Yes in the V2 and V3 I am getting this request type as customfield, but I would like to return it using it like the existing models.ParseAssetCustomFields(response.Bytes, "customfield_10188") to access it with a type.