andygrunwald / andygrunwald/go-jira

FieldsValue need more types to be accepted

Aberta
#647 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Go
Estrelas
1.6k
Forks
500
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

## What happened?
I am trying to create an issue in ServiceDesk that is set up on-premise.
Am getting a an error of:
```golang
{"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:
```json
{
"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` https://github.com/andygrunwald/go-jira/blob/2e11dffbdb9a4710fdc9233e8efe0a124e204e24/onpremise/request.go#L29
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

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.