Code Monkey home page Code Monkey logo

Comments (10)

andygrunwald avatar andygrunwald commented on June 9, 2024 1

Maybe we should add this to the docs.

from go-jira.

PointMeAtTheDawn avatar PointMeAtTheDawn commented on June 9, 2024 1

And look at that,

customfields["customfield_11425"] = &jira.User{
	Name: "myuser",
}

from go-jira.

rbriski avatar rbriski commented on June 9, 2024

Can you check out #117 and see if that helps you?

from go-jira.

PointMeAtTheDawn avatar PointMeAtTheDawn commented on June 9, 2024

Agreed! Just swinging by this for the first time and custom fields are definitely the first stumbling block to adoption. Thanks :).

from go-jira.

PointMeAtTheDawn avatar PointMeAtTheDawn commented on June 9, 2024

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.

PointMeAtTheDawn avatar PointMeAtTheDawn commented on June 9, 2024

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.

rbriski avatar rbriski commented on June 9, 2024

I'm going to close this. If there are additional questions we can reopen.

from go-jira.

febs avatar febs commented on June 9, 2024

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.

kevincantu avatar kevincantu commented on June 9, 2024

Yes, I really want a way to make custom fields from the cli!

from go-jira.

kevincantu avatar kevincantu commented on June 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.