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.




Pulling all issues in a project w/ PHP

api

Hello,

Whereas the Gemini API does offer some flexibility and usability, I was not able to find anything in the documentation about pulling all issues in a project with PHP.

Is there a way to do this? If so, what would the endpoint be?

Thank you, Kevin

ksugihara
· 1
ksugihara
Replies (11)
helpful
0
not helpful

Please see: http://api.countersoft.com/ApiIssues.aspx#Filtered
You might want to look at the Java sample for example how to use the API: http://www.countersoft.com/downloads/v36/CounterSoftGeminiAPI_Java.zip


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

Thanks for the link and the java application.

Looking through the java, it does not look like it calls to the API the same way as PHP.

Do you happen to have some documentation on the syntax of the issue filters? The link does not provide much as far as the syntax for the endpoint URL goes...


ksugihara
· 1
ksugihara
helpful
0
not helpful

You have to post the filter as XML to the api/issues.ashx/issues/filters endpoint:
<IssuesFilterEN>
<UserID>1</UserID>
<Components /><Versions />
<AffectedVersions />
<Resources />
<IssueTypes />
<IssuePriorities />
<IssueSeverity />
<IssueStatus />
<IssueResolutions />
<RiskLevels />
<SearchKeywords />
<ExcludeClosed>true</ExcludeClosed>
<SystemFilter>NoType</SystemFilter>
<IssueID />
<SortField>DateRevised</SortField>
<SortOrder>Descending</SortOrder>
<ReportedByUserId>0</ReportedByUserId>
<CreatedAfter />
<CreatedBefore />
<RevisedAfter />
<RevisedBefore />
<ProjectID>19|</ProjectID
><StartDate />
<DueDate />
<InitialStartDate />
<FinalStartDate />
<InitialDueDate />
<FinalDueDate />
<SavedCustomFieldValues />
<SavedFromReports>false</SavedFromReports>
<SavedFromProjectID>19</SavedFromProjectID>
<CustomFields />
</IssuesFilterEN>


This sample will get all open issues for project id 19


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

Thank you very much! That helped significantly.

Do you have a list of all possible fields? I dont see any fields for adding time above.


ksugihara
· 1
ksugihara
helpful
0
not helpful

Not sure I follow, what are you looking to filter on?


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

Well im trying to setup a script to input time, but the documentation isnt exactly clear as to what the endpoint would be.

The endpoint is /api/issues.ashx/issues/{issueId}/time. Im assuming it requires posting XML again, but im not sure what the filter would be for this. I see Gemini tracks hours and minutes separately


ksugihara
· 1
ksugihara
helpful
0
not helpful

I see, in that case send a IssueTimeEntryEN:
<IssueTimeEntryEN>

<ProjectID>YOUR PROJECCT ID</ProjectID>
<IssueID>YOUR ISSUE ID</IssueID>
<UserID>The User's ID</UserID>
<Hours>1</Hours>
<Minutes>0</Minutes>
<Comment>a comment</Comment>
<TimeTypeID>YOUR TIME TYPE</TimeTypeID>
<TimeEntryDate>YOUR DATE</TimeEntryDate>
</IssueTimeEntryEN>


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

Im getting this error when trying to post the following XML:

int $projectID int $id int $userid int $hours int $minutes

$projectId $id $userid $hours $minutes " . GLEncodeXML("time entry") . " 2

It looks like i dont have the proper type on one of the variables. What are the types for each variable?

[Edit] Looking at the error again, it looks like I dont have Entry Date defined. Im assuming its: , but whats the syntax for the date inside? [/Edit]

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.System.Data at System.Data.SqlTypes.SqlDateTime.FromTimeSpan(TimeSpan value) at System.Data.SqlTypes.SqlDateTime.FromDateTime(DateTime value) at System.Data.SqlClient.MetaType.FromDateTime(DateTime dateTime, Byte cb) at System.Data.SqlClient.TdsParser.WriteValue(Object value, MetaType type, Byte scale, Int32 actualLength, Int32 encodingByteSize, Int32 offset, TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.TdsExecuteRPC(SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd) at NHibernate.Id.IdentityGenerator.InsertSelectDelegate.ExecuteAndExtract(IDbCommand insert, ISessionImplementor session) at NHibernate.Id.Insert.AbstractReturningDelegate.PerformInsert(SqlCommandInfo insertSQL, ISessionImplementor session, IBinder binder) at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object[] fields, Boolean[] notNull, SqlCommandInfo sql, Object obj, ISessionImplementor session) at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object[] fields, Object obj, ISessionImplementor session) at NHibernate.Action.EntityIdentityInsertAction.Execute() at NHibernate.Engine.ActionQueue.Execute(IExecutable executable) at NHibernate.Event.Default.AbstractSaveEventListener.PerformSaveOrReplicate(Object entity, EntityKey key, IEntityPersister persister, Boolean useIdentityColumn, Object anything, IEventSource source, Boolean requiresImmediateIdAccess) at NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId(Object entity, String entityName, Object anything, IEventSource source, Boolean requiresImmediateIdAccess) at NHibernate.Event.Default.DefaultSaveEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event) at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient(SaveOrUpdateEvent event) at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event) at NHibernate.Impl.SessionImpl.FireSave(SaveOrUpdateEvent event) at NHibernate.Impl.SessionImpl.Save(Object obj) at CounterSoft.Gemini.DataProvider.x73a34067f4cd229a.xf606eb5e1032d933(BaseEN x6fcb9c1c812a0558, Boolean x8b15d0e18e6888d9, ISession x45b53be31e53d68b) at CounterSoft.Gemini.DataProvider.x73a34067f4cd229a.xf606eb5e1032d933(BaseEN x6fcb9c1c812a0558, Boolean x8b15d0e18e6888d9) at CounterSoft.Gemini.Business.xef04d86ea23a18a5.x4352ec2d23db89bf(IssueTimeEntryEN x5269bb631b23b761) at CounterSoft.Gemini.Presenter.IssuePresenter.CreateIssueTimeEntry(IssueEN issue, IssueTimeEntryEN time) at CounterSoft.Gemini.Web.Api.IssuesRestHandler.TimeCreate(RequestDetails rd)System.Data.SqlTypes.SqlTypeExceptionException has been thrown by the target of an invocation.mscorlib at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at CounterSoft.Gemini.Web.Api.RestHandler.GetResponse(RequestDetails rd, MethodInfo method)System.Reflection.TargetInvocationExceptionException has been thrown by the target of an invocation.InternalServerError"


ksugihara
· 1
ksugihara
helpful
0
not helpful

Your date should look like:
  <TimeEntryDate>2010-03-10T17:27:32.4544208+00:00</TimeEntryDate>


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

When passing the XML, does it have to contain every field, or just required ones?

Im passing the XML in the pastebin. Im trying to get it to return all open issues in Project 42. Im getting a .net error, which is pasted below the XML.

http://pastebin.com/rxRRmnUy

( "Object reference not set to an instance of an object.CounterSoft.Gemini.Presenter at CounterSoft.Gemini.Presenter.IssuePresenter.GetFilteredIssues(IssuesFilterEN filter) ", " at CounterSoft.Gemini.Web.Api.IssuesRestHandler.IssueFilter(RequestDetails rd)System.NullReferenceExceptionException has been thrown by the target of an invocation.mscorlib at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) ", " at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) ", " at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) ", " at CounterSoft.Gemini.Web.Api.RestHandler.GetResponse(RequestDetails rd, MethodInfo method)System.Reflection.TargetInvocationExceptionException has been thrown by the target of an invocation.InternalServerError" )


ksugihara
· 1
ksugihara
helpful
0
not helpful

Hi,

Please use this XML:
<IssuesFilterEN>
  <UserID>1</UserID>
  <ProjectID>42</ProjectID>
  <IssueID />
  <Components/>
  <Versions/>
  <AffectedVersions />
  <Resources/>
  <IssueTypes/>
  <IssuePriorities/>
  <IssueSeverity/>
  <IssueStatus/>
  <IssueResolutions/>
  <RiskLevels/>
  <SearchKeywords />
  <ExcludeClosed>true</ExcludeClosed>
  <SystemFilter>NoType</SystemFilter>
  <SortField>DateRevised</SortField>
  <SortOrder>Ascending</SortOrder>
  <CreatedBefore />
  <CreatedAfter />
  <RevisedBefore />
  <RevisedAfter />
  <StartDate />
  <DueDate />
  <InitialStartDate />
  <FinalStartDate />
  <InitialDueDate />
  <FinalDueDate />
  <ReportedByUserId>0</ReportedByUserId>
  <CustomFields />
  <SavedFromReports>false</SavedFromReports>
  <SavedCustomFieldValues />
  </IssuesFilterEN>


Mark Wing
· 9108
Mark Wing