Home Analyst Portal

Using api/V3/WorkItem/GetGridWorkItemsMyGroups

Stephane_BouillonStephane_Bouillon Customer Advanced IT Monkey ✭✭✭

Hi,

I'm trying to use a Power Automate Flow to obtain a list of workitems using the API. I have successfully obtained a token (I think)

The next call to GetGridWorkItemsMyGroups fails

Once I get this one working, the rest should be a snap. I must be overlooking something obvious.

Any pointers ?

Stephane

Answers

  • Geoff_RossGeoff_Ross Cireson Consultant O.G.

    Hi Stephane,

    Are you using the HTTP with Azure AD connector? That's a premium connector that I don't have access to so I can't fully replicate but I would try setting the header to contain the 'Bearer' parameter name.

    Header should be 'Bearer <token>'

    From a pure API point of view, it also gets sent as a list of Headers in an array so that might be needed too.

    Geoff

  • Mikkel_MadsenMikkel_Madsen Customer Advanced IT Monkey ✭✭✭

    Uhhh interesting - We are looking into the same stuff but I need some kick-off help to start with it (@Adam_Dzyacky ) 😉

  • Stephane_BouillonStephane_Bouillon Customer Advanced IT Monkey ✭✭✭

    I think I got one step further with @Geoff_Ross suggestion. However, this api expects a userid querystring parameter, and the documentation specifies this should be a guid. How do I get this ? Do I need to convert the user in a guid first using another API ?

  • Mikkel_MadsenMikkel_Madsen Customer Advanced IT Monkey ✭✭✭

    @Stephane_Bouillon regarding the token - check this one out - you can make one from the admin portal so you don't have to put user and password in flow

    https://support.cireson.com/KnowledgeBase/View/2507#!/

  • Stephane_BouillonStephane_Bouillon Customer Advanced IT Monkey ✭✭✭

    I think I have the token covered. The user and password would be passed by a powerapp as parameters. However, in the GetGridWorkItemsMyGroups request, a userid is expected. I don't know why I still need to pass this, and I don't know how to convert a userid to the correct guid.


  • Geoff_RossGeoff_Ross Cireson Consultant O.G.

    Hi Stephane,

    You can grab a userId with PowerShell from SQL if you are going to hardcode. If you need something dynamic, you’ll need another API call first. What do you have, Username??

    Geoff

  • Stephane_BouillonStephane_Bouillon Customer Advanced IT Monkey ✭✭✭

    In powerapps, I would typically have the email of the logged on user, which is what I need. I have a process that is executed in a powerapp, and I want to allow the user to reference an incident by selecting from a list of incidents for the support group.

  • Mikkel_MadsenMikkel_Madsen Customer Advanced IT Monkey ✭✭✭
    @Stephane_Bouillon if you haven't found it you can get the user info by calling this one first
     api/V3/User/GetUserRelatedInfoBySIPAddress?sipAddress={sipAddress}
    

    where sip address is the email you got

  • Stephane_BouillonStephane_Bouillon Customer Advanced IT Monkey ✭✭✭

    I do get a response from this request, and it's huge, so I think I'm getting all the data for the user, but unfortunately the documentation does not specify the schema of the response, so I'm not able to parse it correctly. Do you happen to have the response schema in the format application/json, text/json ?

    I tried to configure the schema by specifying the response I got as a sample, but that failed.

  • Stephane_BouillonStephane_Bouillon Customer Advanced IT Monkey ✭✭✭

    From inspecting the unparsed response It looks like I'm getting all the incidents, assets and other info related to the user in the response, so we're definitely making progress.

    Thanks Mikkel & Geoff

Sign In or Register to comment.