Gemini Community Support Site

This Gemini community support site can be used to find solutions to product issues. You can log in using Open Id, Google Profile and even Facebook. Feel free to ask a question or browse FAQs and documentation. Product tour videos are also available along with how-to videos demonstrating key Gemini capabilities.




Add custom field data when creating a new issue using the webservice

web-app

I am creating a new issue using the webservice and I need to add data to my custom fields. I have not been able to find documentation or an example of how to do this. I have tried creating a "CustomFieldDataEN" object populating it with data and then passing it into my "IssueEN" object. When I try to do this I get a type conversion error. What is the process that I need to be using to do this. Below is the code that I am currently using:


IssueEN data = new IssueEN();
            UserEN user;
            bool result = false;
            CustomFieldDataEN Cfield1 = new CustomFieldDataEN();
            Cfield1.CustomFieldID = 1;
            Cfield1.CustomFieldData = "Test";
           

            IssueComponentEN[] iceComps = new IssueComponentEN[1];
            iceComps[0] = new IssueComponentEN();

            iceComps[0].ComponentID = 1;
            data.Components = iceComps;
            data.FixedInVersion = 0;
            data.IssueLongDesc = "This is another test";
            data.IssuePriority = 1;
            data.IssueResolution = 1;
            data.IssueStatus = 1;
            data.IssueSummary = "This is another test";
            data.IssueType = 1;
            data.IssueSeverity = 1;
            data.ReportedBy = 1;
            data.RiskLevel = 1;
            data.Visibility = 1;
            data.VisibilityMemberType = GeminiConstant.SecurityMemberType.GlobalGroup;
            data.IssueCustomFieldData[0] = Cfield1;
            data.ProjectID = 1;

            // Note that this might throw a security exception.
            ServiceManager serviceManager = new ServiceManager("http://myserver/gemini/webservices");
            result = serviceManager.SetAuthenticationTokenOnAllServices("username", "password");
            user = serviceManager.AuthorisationServices.LogIn("username", "password");
            data.IssueID = serviceManager.IssueServices.CreateIssue(data);

helmsb
· 1
helmsb
Replies (1)
helpful
0
not helpful

This should work:

CustomFieldDataEN[] Cfield1 = new CustomFieldDataEN[1];

            Cfield1 = new CustomFieldDataEN();
            Cfield1[0].CustomFieldID = 1; // Make sure this is a vaild custom field id.
            Cfield1[0].CustomFieldData = "Test";

....

data.IssueCustomFieldData = Cfield1;


Saar Cohen
· 5000
Saar Cohen