-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Custom drop down fields? #52
Comments
We also had a lot of custom fields. What type is your CustomField?
To get the values:
And the update part:
|
I'd love to hear how I can simplify that process @toertchn ? What about a: Your "get value" code might look like this:
And the update part:
Other suggestions are also welcome. |
I've implemented what I suggested, it's in PR #63 you can see the code how it could work here:
I'd love to get some feedback on this... |
Btw.. In the example code I use e.g. "customfield_10001", but this is the name I used to create the field, in the code it will figure out the read ID. I was also confused, this shows how complex the part of getting the right custom field IDs is... |
Thank you - I try to test it on my next free day (maybe 6.1.2021) To get all fields with type and schema you can call: There you can find the id, name, name of the field in clauses and the type. All known implementations of the CustomFieldType are listet there: Our Jira server hosts the whole Company. So we have nearly 400 different custom fields over all projects. This is also the reason why I don't need all this information in the results. This costs a lot of traffic. The hardest part is testing all these different things. |
Ah yes, Heilige Drei Könige! Due to the epidemic I don't have many days, as I need them for my kid, so I'm glad we have at least one "Feiertag"
Yes,
I think will add a FieldDomain for this, to have better field support (creating etc.).
Sounds very familiar, it's the same with the company I work for.
Yeah, in this case I already tested the code, as what I pointed to is the unit test for the field handling. |
The extensions AddCustomField & GetCustomField works as expected. There exists an api for custom fields (api/2/customFields) but I'm just a little admin without the rights to access them. So I found the api https://jiraserver/rest/api/2/issue/createmeta?projectKeys=PROJECTKEY&expand=projects.issuetypes.fields The new way seems to be: But this doesn't list me one custom field we use. Don't know why. I also can't check this but i can imagine that a custom field also needs to be assigned to a project to get listet there? Its correctly listed in the GetFieldsAsync() result. |
That is actually valuable information, thanks |
Can you change the The question mark should do the fix: |
I did this but I've also change the code to include a TryGetCustomField, otherwise you don't know the difference between a null value and not having the field at all. Also I've added a HasCustomField. |
Improvements of custom field usage as suggested in #52
I am trying to create an issue with custom fields (drop downs!) but I always get a bad request response upon issue creation.
Custom fields I can set without problems but only string type fields. The two fields I would like to set are drop downs and nothing seems to work for them, the client call always returns a 400 bad request (Exception message: "Field 'Change Reason' cannot be set. It is not on the appropriate screen, or unknown.").
Here is how I try to set such a drop down field:
new Issue { Fields = new IssueFields { CustomFields = { {"customfield_10401", "Sonstiges"} } ...
I am not sure if it's fine to simply pass a string of the drop down item to select as the value. I also tried a single-entry anonymous array and id (e.g. 10305) instead of the value ("Sonstiges") but that didn't change anything. Is it possible to set a custom field that is a combobox?
Btw. the field is definetly available in the issue type (required even). And I can create the issue with a simple Jira CLI client without a problem. The field is also available when I use
client.Server.GetFieldsAsync()
The text was updated successfully, but these errors were encountered: