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

Cannot set value for CustomField defined as drop-down type #333

Closed
ilCosmico opened this issue May 11, 2018 · 2 comments
Closed

Cannot set value for CustomField defined as drop-down type #333

ilCosmico opened this issue May 11, 2018 · 2 comments
Assignees
Labels

Comments

@ilCosmico
Copy link

Hello,

I need to create a ticket with a custom field set as drop-down, but I cannot figure out how to do it.

string fieldName = "Version"; // this field can have value 9, 10, 11
long id = 333; // the field id
string myVersion = "11"; // the value I want to set

// attempt1
CustomField cfVersion = new CustomField()
{
    Id = id,
    Value = myVersion
};

// attempt2
CustomField cfVersion = new CustomField()
{
    Id = id,
    Value = new CustomFieldOptions()
    {
        Id = id,
        Name = fieldName,
        Value = myVersion
    }
};

What am I missing?

@mozts2005
Copy link
Member

@mozts2005 mozts2005 self-assigned this May 14, 2018
@ilCosmico
Copy link
Author

ilCosmico commented May 15, 2018

I found the solution by myself. The right way was the "attempt1" by passing as value the tag used on ZenDesk for the drop-box item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants