Get instances of running MS Flow Approval Workflow using Rest API - sharepoint

I am looking for APIs to get list of run instances of a workflow on SharePoint Online.
From Microsoft documentation I can get list of workflows in the tenant.
https://learn.microsoft.com/en-us/power-automate/web-api
I would like to get all running workflows of a particular workflow, not only assigned to me

As far as I am aware that Web API does not have an entity for the cloud flow runs (only the desktop flow ones, which is the flowsession entity).
However, you should still be able to use the Service.flow.microsoft.com approach.
For example Stefan Strube has a nice blog on how to create a custom connector for this:
https://2die4it.com/2020/07/08/custom-connector-to-get-flow-run-history/

Related

What is the main Ad's and Con's using MS Graph API vs MS Azure SDK

We have teh need to interact with our customers AD from Jira in order to handle automatically user onboarding.
For that we have 2 deifferent approach :
Using Microsoft Graph API
We call directly from Jira Script Runner plugin using groovy script POST and GEt methods, this directly within Jira environment
Using Microsoft Azure SDk for python
Using this approach will need to build a python script which is store in the dedicated location on the VM and calling that scrip from Jira using Groovy script
In the first approach we are using only 4 API call only for how request and we are all time scripting within Jira environement.
ON the second approach we need to deal with 2 types of script ( python and groovy)
Based on your advise, do you see what could be the best based on your experience in order to help me chose one or the other ?
Thanks for help
regards
See https://learn.microsoft.com/azure/active-directory/develop/active-directory-graph-api
We strongly recommend that you use Microsoft Graph instead of Azure AD
Graph API to access Azure Active Directory (Azure AD) resources. Our
development efforts are now concentrated on Microsoft Graph and no
further enhancements are planned for Azure AD Graph API. There are a
very limited number of scenarios for which Azure AD Graph API might
still be appropriate;
Hence I will suggest Microsoft Graph
I would follow up to Laurent, and say, the better solution is the solution that has the least amount of complexity while accomplishing everything you need to do.
In this case according to your own post, that is clearly just calling graph API directly from your groovy scripting in Jira.

Azure DevOps - Create a work item from incoming email

I'm in the process of setting up an in-house Azure DevOps environment. But I'm stuck at a point where I need to set up an email integration.
Question: is it possible within Azure DevOps to create a work item (in general/specific to a project) upon receiving an email?
Trigger: Users report issues via a generic email address (like support email)
Manage: Azure DevOps to capture this email (monitor inbox of this generic email address)
Output: A new work item is created with the contents/subject from the captured email.
Note: Issues could either be a bug, minor usability or other supports
I did look into MS Power Automate using flow. But not ideal in my
case
Searched market place for a possible plugin. But couldn't find one
which does this
Thanks in advance for any help or direction.
Thanks you for all fellow contributors who suggested alternative approach. Unfortunately, these suggestions doesn't solve my concern at its level and hence I raised a feature request in Azure DevOps Server forum. You may find the request here and please vote it if you think it is relevant to you.
The easy way is to use the TFS Work Items from Outlook tool.
It's give you the ability to create a work item from outlook and also create rules for create work items automatically (with templates).
Note: the name is TFS Work Items but it should works also with ADO.
Azure DevOps does not contain feature to create work items through email. You can try:
TeamBox (pop3)
As you mentioned MS Power Automate or Azure Logic App.
Create your solution with existing resources. As example: Mail.dll - .NET email component (IMAP, POP3, S/MIME), Create Work Item in Team Services Through API
As Shamrai Aleksander mentioned above, for now Azure Devops Service doesn't support creating WITs from email.
Not sure if above extensions shared by Shamrai Aleksander and Shayki Abramczyk meet your needs well, I think you can also consider posting a feature request if you do want such feature comes true in Azure Devops Service. Since it's a good idea, feel free to suggest a feature to User Voice Forum of ADO.
Your requirements seems to be similar to this one which is posted in 2019, I recommend you can post a new one to share your feedback. Also, share the link in your question and members who interested in that would vote for you! Hope it helps.
This is a good use case for a Logic App. You can create an app that triggers on a new email, using the Outlook connector, and then create a work item using the DevOps connector.
You can also add logic in the middle (using the Control connector and variables, for instance), to assess the content of the email and dynamically set the target project, work item type, or tags.
You can user Microsoft Power Automate to do that.
You activator would be receiving an email and the rest of the workflow is up to you. It creates issues correctly and there is even a workaround to add files to the issue with power automate.

How do I update a SharePoint list via REST API in a script ran on another server for Sharepoint 2013 an also Sharepoint Online?

I need to update data in a sharepoint list remotely via a script that runs on a schedule. We currently are using sharepoint 2013 foundation but will be moving to sharepoint online in 6 months or so. I would like to know how to do this via the REST api for both 2013 on prem and online versions. Im having a hard time wrapping my head around all the different auth models, sharepoint products, available apis, frameworks etc and when reading the documentation on MSDN I cant be sure which is relevant to what version of sharepoint etc.. Anyway, so far im thinking or the 2013 on prem sharepoint I should use the High-trust certificate auth option so my script is authenticated via a certificate. Do I need to create an add-in for script to register it as an app that will talk to the rest api? The reason Im not sure is sharepoint itself never really has to call on my script and its not a webpart or page or antyhing that gets displayed on sharepoint so im a bit lost.
As for how to push data into sharepoint online lists, im assuming I would then have to register the script as a providor hosted Add-in and authenticate using OAuth2 via Azure ACS server.
Does this sound like the best way to acheive my goal? Am I on the right track or is their an eaiser option? Is there anyway I can just use a Active Directory user account in the script to make authenticated requests instead of having to create certificates trusts and create addins etc?
Update:
Heres some more info on what I'm trying to do...
The project Id like to start will be a Node or PHP script that runs on a seperate server and pulls data from a third party source, making calculations on it and then pushes the results into some Sharepoint lists. Then running this on a schedule every night to keep the Sharepoint lists up to date. I know how to do everything except getting started with Sharepoint; how to establish the connection and authentication basically.
What id like to do is access the REST apis for lists and libraries from Node or PHP which would obviously be running externally to Sharepoint. I just don't really understand how to get started. My understanding is there is Sharepoint hosted apps (client side javascript that can access the SP apis), and provider hosted apps (which is essentially an iFrame to another web app). So out of the two I'm looking at provider hosted, but do provider hosted apps only run when called? Do they need to present a front end to show in an iframe? My project only needs to push data into lists overnight. And so do I need to register the project as a provider hosted app?? Or how do I go about getting started? And then I'm lead to believe that the app model is the 2013 way of programming for Sharepoint and the new 2016/online way is Sharepoint framework (SPFX). But then the only examples I'm seeing for this is client side apps. The second project id like to do is to make a client side app which will take the data thats in the lists from project 1 and display that in certain ways dynamically using react. So I'm fairly comfortable knowing where to start for project 2, ill just straight into developing a client side react app that uses SPFX. However I'm totally stuck on starting project 1. Where do I start for project 1? What are my options?
As far as I understand your question, You need to update your on prem list from schedular and later you will update the list in your sharepoint online.
We you can create a Provider hosted app and through configuration you can switch your destination easily.
OR you can think new way to do that. You can use Node JS timer service which insert to your on prem usign rest api later the same code will work for online you just need to change the destination.
Currenlty we are also donig it with Node. Below is the simple code to create timer in nodejs.
what is does, it read the crednentials from file and email to the user.It just a simple code and can be use to insert to SP list usign rest api.
https://github.com/halfice/Node-JS-Timer-SharePoint/blob/master/app.js
furthermore It would be more clarify if you could share picture of what you want to do

SharePoint web hooks without Azure?

Is it possible to create SharePoint web hooks without Azure?
I have a requirement where I need push notifications from a SharePoint list, I read that SharePoint web hooks can be used to achieve it, but customer doesn't have an Azure account and looking into possibilities where it can be achieved without using Azure.
It is absolutely possible. The premise of WebHooks is that SharePoint Online will HTTP POST to a URL you define when the event happens. The only thing that is important is that the WebHook service you create and register with SharePoint Online has to be accessible to the SharePoint Online service. Without getting into specialized networking arrangements with Microsoft this means your service has to be publicly addressable. Azure is used as a common example because it is publicly addressable, it is a Microsoft product and lots of SharePoint Online customers are also Azure customers. There is however nothing that would stop you from using your own hosting solution.
Here is a presentation on WebHooks: https://docs.com/OfficeDevPnP/1223/pnp-web-cast-sharepoint-webhooks

Call external service from SharePoint Online web part

We are in the process of moving an on-premise SharePoint installation to SharePoint Online. We have a number of existing C# web parts that we need to convert. These web parts currently access some of our on-premise data... we need to get the web parts working on SharePoint Online; however, we're not certain of the best approach.
We've looked at BCS, but it seems that it is geared more towards synchronizing lists of data via basic CRUD methods. For many of our applications, we are not looking to synchronize lists, we are looking more towards action-oriented methods on a service that can be called on-demand as needed by the web part.
We don't believe the call can be client-side, as the users will often be accessing SharePoint Online from workstations that are not joined to our domain, and we don't want the user to have to separately authenticate to our service (i.e. we want our service to trust only the SharePoint Online backend).
Our ideal setup would be to have our C# code for the web part call into our web service (hosted on our domain, authenticating with a service account from the SPO secure store), passing the current username from the SharePoint context, and getting back a response that the web part can then use for its processing.
But as we understand, the web parts in SharePoint Online are sandboxed in such a way that they cannot make external HTTPS calls via HttpWebRequest.
We've searched for how-to examples or documentation related to our use case, and haven't found anything saying it's possible or that it's not possible. Does anybody know if it's possible for a web part to get data in this way? Is there some other direction we should be taking to achieve this?
In SharePoint online, if you are developing a SharePoint hosted app; You will be able to call external endpoints (EPs) after adding these endpoints in the manifest file.
If you haven't added these endpoint to the manifest file, This means you are not permitting the app to call an external EPs.
You don't need BCS in SharePoint online to call external EPs. Here is a sample on how to do this using JavaScript.
https://msdn.microsoft.com/en-us/library/office/fp179895.aspx
Let me know if you have any other questions.

Resources