Skip to content

FieldsValue need more types to be accepted #647

Open
@pmmalinov01

Description

@pmmalinov01

What happened?

I am trying to create an issue in ServiceDesk that is set up on-premise.
Am getting a an error of:

{"time":"2023-10-23T16:28:52.746847979+03:00","level":"INFO","msg":"request failed. Please analyze the request body for more details. Status code: 400"}

I am may be going wrong about it but I am see in a manual approach a ticket I created from the UI and using curl/firefox to see the ticket I see:

{
          "fieldId": "customfield_29695",
          "label": "Jira project",
          "value": {
            "self": "https://jira.REDACTED.net/jira/rest/api/2/project/16910",
            "id": "16910",
            "key": "AT",
            "name": "Foo Bar Paz",
            "projectTypeKey": "service_desk",
            "avatarUrls": {
              "48x48": "https://jira.REDACTED.net/jira/secure/projectavatar?pid=16910&avatarId=25003",
              "24x24": "https://jira.REDACTED.net/jira/secure/projectavatar?size=small&pid=16910&avatarId=25003",
              "16x16": "https://jira.REDACTED.net/jira/secure/projectavatar?size=xsmall&pid=16910&avatarId=25003",
              "32x32": "https://jira.REDACTED.net/jira/secure/projectavatar?size=medium&pid=16910&avatarId=25003"
            },
            "projectCategory": {
              "self": "https://jira.REDACTED.net/jira/rest/api/2/projectCategory/10730",
              "id": "10730",
              "description": "",
              "name": "REDACTED"
            }
          }

to me, it seems that the value used in the []jira.RequestFieldValue allow only string

Value string `json:"value,omitempty" structs:"value,omitempty"`

May changing this to empty interface or any we can allow any value to be passed

What did you expect to happen?

A ticket to be created successfully

How can we reproduce it (as minimally and precisely as possible)?

try to create a task in ServiceDesk

Minimal code helps us to identify the problem faster.
This depends on your jira used for testing/development. To be able to reproduce it you need field that accepts a bit more comple than a string

Anything else we need to know?

Your Environment

Include as many relevant details about the environment you experienced the problem in

  • go-jira version (git tag or sha): main
  • Go version (go version): go version go1.21.0 linux/amd64
  • Jira type (cloud or on-premise): on-premise
  • Jira version / Api version: v2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions