Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FieldsValue need more types to be accepted #647

Open
pmmalinov01 opened this issue Oct 23, 2023 · 0 comments · May be fixed by #646
Open

FieldsValue need more types to be accepted #647

pmmalinov01 opened this issue Oct 23, 2023 · 0 comments · May be fixed by #646

Comments

@pmmalinov01
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant