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.




What is the proper way to create a new issue and set custom fields on that issue

api

We are using the .net library to access the web service.

We need to know the correct way to create a new issue and then set some custom field data on that issue and save.

We keep getting errors.

Please provide short sample code to do this.

Thanks,

Jim

jimneumann
· 1
jimneumann
Replies (4)
helpful
0
not helpful

There you go (make sure ids are correct):

ServiceManager sm = new ServiceManager("http://localhost/gemini/", "manager", "manager", "", false);
            IssueEN issue = new IssueEN();

            issue.ProjectID = 2;
            IssueComponentEN[] comps = new IssueComponentEN[1];
            comps[0] = new IssueComponentEN();
            comps[0].ComponentID = 8;
            issue.Components = comps;
            issue.IssueLongDesc = "Desc";
            issue.IssuePriority = 1;
            issue.IssueResolution = 1;
            issue.IssueSeverity = 1;
            issue.IssueStatus = 1;
            issue.IssueSummary = "issue title";
            issue.IssueType = 1;
            issue.RiskLevel = 1;
            issue.ReportedBy = 1;
            issue = sm.IssuesService.CreateIssue(issue);
            CustomFieldDataEN cust = new CustomFieldDataEN();
            cust.CustomFieldID = 1;
            cust.CustomFieldData = "4";
            cust.ProjectID = 2;
            cust.IssueID=issue.IssueID;
            cust.UserID = 1;
            sm.CustomFieldsService.SaveCustomFieldData(cust);


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

How do you expect the user to get all the database IDs? In my case, I am trying to create an issue with the project name, version number, assigned to user name and reported by user name. For each one of these, I had to find a service and get the corresponding database ID. For version, I had to get all versions and loop through them myself. Shouldn't there be a more user friendly API?


hlu
· 1
hlu
helpful
0
not helpful

That is why we provide the other services, so you can get the Id, name, desc etc...
However, if you feel that there is a better way, feel free to share it.


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

I do not know if there is a "Better" way to do it, however I have a few suggestions/options that might make consuming the web service easier.

1) Any place where we are having to set the Index of a property, give the option to set the Description to the correct String that coincides with that Index, or have the WS handle filling the fields automatically where possible. An example of the latter is an Issue's Project ID: This should be automatically set by the WS or not required unless specifically defined in the Object sent to the WS.

2) Use Dictionaries to give easy access to consumers of the WS that has a KeyValuePair(of String, Integer) with Description(Name) and Index. This would only be slightly more effective than the current means if at all.

Honestly the in my opinion the web service should automatically set or not require anything that it can get on its own.


Gent
· 1
Gent