Jump to content

RichardD

Hornbill Users
  • Posts

    39
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

RichardD's Achievements

Explorer

Explorer (4/14)

  • One Month Later
  • Week One Done
  • Collaborator
  • Reacting Well
  • First Post

Recent Badges

2

Reputation

  1. I didn't need access to entityGetBrowseMetaData... the response returns a helpful exception... So, it's just the issue of how to filter by Service ID I still need to solve.
  2. @Steve Giller The API key I'm using does not have permission to invoke data::entityGetBrowseMetaData. Would you be able to advise which option I need to ask my colleague to enable to allow me to do that, please? Although, if that reveals that both h_fk_serviceid and h_fk_servicename are not searchable, what other options would be available to filter based on the service? Our organisation is now using Service Manager for two business areas. I had some success filtering on h_fk_team_id, as the two business areas have team IDs starting with different prefix, but before new Requests are assigned to a team that column value returns a null value.
  3. Thank you. When adding that column filter I do unfortunately end up with zero Requests returned for a query that returns data without the filter. May we amend which columns are searchable for an entity in our configuration? Or could you suggest another way I might filter Requests? I don't believe the API response includes the service id or name for each Request, so I did not spot a way to filter on the client side.
  4. @Victor @Steve G Hi. I now need to also filter the Requests based on the service id. I have tried h_service_id and h_fk_service_id without success. I do not have access to the Entity Explorer, so would you be able to let me know the column name, please? xmlmc.AddParam("searchFilter", new List<XmlmcParam>() { new XmlmcParam() { Name = "column", Value = "h_service_id" }, new XmlmcParam() { Name = "value", Value="1" }, new XmlmcParam() { Name = "matchType", Value="exact" } }); For the benefit of anyone else stumbling on this thread, that might wish to wildcard filter Requests based on the Team ID the calls are assigned to, the following search filter worked well for me... where, for example, we had team IDs of "ABC/team1", "ABC/team2" and "DEF/team1" and we want to only include the ABCs. xmlmc.AddParam("searchFilter", new List<XmlmcParam>() { new XmlmcParam() { Name = "column", Value = "h_fk_team_id" }, new XmlmcParam() { Name = "value", Value="ABC/" }, new XmlmcParam() { Name = "matchType", Value="wildcard" } });
  5. Has the getUserProfileAssets method been deprecated? Browsing https://docs.hornbill.com/ this morning and wasn't able to find it mentioned.
  6. My apologies. The "all" matchScope is working. Coincidentally, every user I tested my code against had a single call. When I added "status.closed" as another searchFilter the request returned 10. Thanks again for your help.
  7. @Steve G Thought it best to post in this thread, rather than the Python topic you kindly replied to me in previously. https://docs.hornbill.com/esp-api/services/data/entityBrowseRecords2/index If I'm not misunderstanding, shouldn't "all" work for me as the matchScope as I'm searching against multiple columns with my three 'h_status' column searchFilter params being treated as a sub-criteria with 'any' value matching?
  8. Permissions issue resolved. But, I am having trouble constructing an entityBrowseRecords2 search filter collection that matches a user AND one of the request status. If the matchScope is "any", the response understandably includes Requests matching the user AND matching any of the three specified status. A matchScope of "all" will not work as Requests will only match one status. xmlmc.AddParam("application", "com.hornbill.servicemanager"); xmlmc.AddParam("entity", "Requests"); xmlmc.AddParam("matchScope", "any"); // -- need 'any' for the status filters but 'all' for user + status xmlmc.AddParam("searchFilter", new List<XmlmcParam>() { new XmlmcParam() { Name = "column", Value = "h_fk_user_id" }, new XmlmcParam() { Name = "value", Value= svcMgrUAID }, new XmlmcParam() { Name = "matchType", Value="exact" } }); xmlmc.AddParam("searchFilter", new List<XmlmcParam>() { new XmlmcParam() { Name = "column", Value = "h_status" }, new XmlmcParam() { Name = "value", Value="status.onHold" }, new XmlmcParam() { Name = "matchType", Value="exact" } }); xmlmc.AddParam("searchFilter", new List<XmlmcParam>() { new XmlmcParam() { Name = "column", Value = "h_status" }, new XmlmcParam() { Name = "value", Value="status.new" }, new XmlmcParam() { Name = "matchType", Value="exact" } }); xmlmc.AddParam("searchFilter", new List<XmlmcParam>() { new XmlmcParam() { Name = "column", Value = "h_status" }, new XmlmcParam() { Name = "value", Value="status.open" }, new XmlmcParam() { Name = "matchType", Value="exact" } }); xmlmc.AddParam("orderBy", new List<XmlmcParam>() { new XmlmcParam() { Name = "column", Value = "h_datelogged" }, new XmlmcParam() { Name = "direction", Value="descending" } }); xmlmc.AddParam("maxResults", 10); // -- limit to ten xmlmc.Invoke("data", "entityBrowseRecords2");
  9. Hmmm. That only returns a single Request, even if I remove the rowstart, limit and statusFilter params.
  10. xmlmc.AddParam("queryName", "getCustomersRequests"); xmlmc.AddParam("resultType", "allData"); xmlmc.AddParam("customerId", "USER-ID"); xmlmc.AddParam("rowstart", "0"); xmlmc.AddParam("limit", "10"); xmlmc.AddParam("statusFilter", "status.onHold"); xmlmc.AddParam("statusFilter", "status.new"); xmlmc.AddParam("statusFilter", "status.open"); xmlmc.Invoke("apps/com.hornbill.servicemanager/Requests", "getCustomerRequests"); var responseJSON = xmlmc.GetResponseParamAsString("queryExecJSON");
  11. Or would I be better off sticking with https://api.hornbill.com/apps/com.hornbill.servicemanager/Requests?op=getCustomerRequests in this instance?
  12. Thanks @Steve G If I am also including a searchFilter for column h_fk_user_id. (Probably should have mentioned that in my previous post, sorry.) Will the 'any' matchType return all calls for the user and all calls with one of the three status? Or is there a way to cunning way to do the equivalent of a T-SQL WHERE user="1" AND (status =1 OR status=2 OR status=3) (I would of course use an T-SQL IN rather than the parenthesised ORs)
  13. Sorry @Steve G Hopefully my last question... How do you specify a list of values for a searchFilter, please? When searching for Requests for a specified h_fk_user_id, I have tried a few random variations of formatting the value, with the matchType as both wildcard and exact. The request is working for a single value. Just need to get it working for these three open call types. xmlmc.AddParam("searchFilter", new List<XmlmcParam>() { new XmlmcParam() { Name = "column", Value = "h_status" }, new XmlmcParam() { Name = "value", Value="status.onHold,status.open,status.new" }, new XmlmcParam() { Name = "matchType", Value="wildcard" } });
  14. Please would you advise which permission/role we should add to give the account/token we use for the API access to query 'Requests' using data::entityBrowseRecords2 ? These are the permissions it currently has: Platform: Admin Role | Entity Viewer | Reporting Admin Service Manager: Asset Management User | Change Calendar Viewer | Change Management Full Access | Incident Management Full Access | Service Request Full Access | Services Manager
×
×
  • Create New...