Comments (10)
Maybe we should add this to the docs.
from go-jira.
And look at that,
customfields["customfield_11425"] = &jira.User{
Name: "myuser",
}
from go-jira.
Can you check out #117 and see if that helps you?
from go-jira.
Agreed! Just swinging by this for the first time and custom fields are definitely the first stumbling block to adoption. Thanks :).
from go-jira.
In terms of getting custom fields working at all, I think you're really close @ashakabra. Possibly you just need to treat the map as the group of custom fields (even if you're only using one) - notably, where you used "id" for your key, that's where I needed to put the customfield's #. Like so:
customfields["customfield_10631"] = "value you want to store!"
i := jira.Issue{
Fields: &jira.IssueFields{
Description: "Test Issue",
Unknowns: customfields,
},
}
issue, resp, err := c.TicketClient.Issue.Create(&i)```
Would work if customfield_10631 was the field you cared about.
from go-jira.
My next question here is how to handle more esoteric types of custom fields, like User Pickers. E.g. "customfield_11425":"data was not an object" when trying to provide a string to a User Picker. Not sure how to package that up to go-jira just yet, but will take a look.
from go-jira.
I'm going to close this. If there are additional questions we can reopen.
from go-jira.
How would it be possible to achieve the same via the CLI?
something like
jira create --project ANTANI --issuetype Strappanai -o summary="La morte" -o description="Ci sono cose molto belle." -o customfield_12117="scrafunzio"
is not working.
Thanks,
from go-jira.
Yes, I really want a way to make custom fields from the cli!
from go-jira.
The best I can do today is call jira create ...
and then paste this into the YAML edit:
fields:
project: SAMPLE
...
assignee:
emailAddress: [email protected]
customfield_999:
id: "99999"
I find that doing that, helpful errors appear when you get the id wrong (this is a struct field with name / id).
from go-jira.
Related Issues (20)
- Can't connect to Jira account (401 unauthorized) HOT 3
- attachments created by PostAttachment method cannot be viewed by customers HOT 1
- GetTransition not work HOT 1
- RemoveWatcher throws 400 error due to missing query parameter
- Creating issue with go-jira/v2/cloud failed with status code 400 HOT 2
- PUT request fails even though json is correct HOT 3
- Calling the GetWatchers() function results in a stacktrace HOT 1
- `IssueFields.Unknowns` and `IssueFields.Names` not returned in `Issue.SearchWithContext` api HOT 1
- Use Personal Access Tokens instead of username and password HOT 2
- Add support for retrying failed requests HOT 1
- issue field creator json tag is wrong HOT 2
- FieldsValue need more types to be accepted
- When accountId=="", it will cause service panic
- Unable to install go-jira on apple M1 laptop HOT 1
- Add support in rest/api/3/issue HOT 2
- Reading from a closed body in case of a network error during body read
- Support POST version for long JQL queries
- IssueLinkType Name not found
- Add method for get priority schema by project ID
- Cloud: Issue.DownloadAttachment is using deprecated API
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-jira.