VSTS Get ID of Stored Queries - azure-devops

I am trying to execute a VSTS stored query using WorkItemTrackingHttpClient
The stored query is identified by it's ID and there are code samples to programmatically get this ID. However, I can't seem to figure out how I can get this ID within VSTS online view. Clicking on the query lists the workitems returned bye this query but the query ID isn't listed anywhere. Is this due to privileges of my authentication or I am overlooking something.

You can get the query ID in the URL:
Select a query
The URL format will be like: https://[xxx].visualstudio.com/[project]/_queries?id=effb4d62-1b9b-42e9-af7c-dbef725fca4a&_a=query.
The id is the value of id parameter.

Related

How do you get the user ids of the users who have read access to a specific record using the Salesforce REST API?

I am trying to retrieve a list of user ids that have read access to a specific record from the Salesforce REST API.
I have been able to use the UserRecordAccess SObject and the following SOQL query to check if a single user has access to the record.
SELECT RecordId, HasReadAccess FROM UserRecordAccess WHERE RecordId = '{insert record id}' AND UserId = '{insert user id}' AND HasReadAccess = true
However, a limitation of this query is that UserRecordAccess does not let you "SELECT" the UserId.
e.g
SELECT RecordId, UserId FROM UserRecordAccess
Is there another way to get this information?
I want to avoid sending a request for every single user per record.
Any help would be greatly appreciated.

Type of returning data in Salesforce SELECT

Please, help me to understand which type of data is returned after SELECT?
For example, we've got such request: [SELECT Name FROM Account].
Have we got Account object or only String for Name? And if we get Account could we turn to other Account fields in addition to Name?
If there is only one Account in your org, you can store the result of this query in Account's instance but it is recommended to store the query result in List of Account (List).
A SOQL query returns a list of records of the Object on which you're querying, in this case it's Account. To access other fields you'll have to add them to the SELECT statement.
That query returns a list, regardless of how many records, if any, get returned. If you specified 'Limit 1' it would return an Account object. In either case, only the Name field would be populated. If issued from Apex, any attempt to reference other fields on the result Account would throw an error.

Odata results displaying user id values under certain columns instead of usernames when data imported into excel from devops?

I imported certain Workitems data from my Devops project into excel using Odata queries.
In that data under certain columns for eg: AssignedToUserSK its showing the user id values like this 06ea0e70-432d-4315-8ffd-87706966a7b6
Instead of this i need the username to be displayed instead of user id.
How to solve this?
If you want to see usernames in the Odate query instead of user id, you need add the columns AssignedTo.UserName, CreatedBy.UserName and ChangedBy.UserName. Then you can see the user name.
Result:

How to get the particular row by column in smartsheet api

I am using smartsheet as a database and I want to query the smartsheet by column name equals value like in sql db for example: To get the particular row of Employee sheet where salary equal to 10000. But documentation describes only how to get list of rows and how to update and delete rows by row id.
https://smartsheet-platform.github.io/api-docs/?java
What i want is to achieve without knowing id of the row. But I can do by search function by searching the salary of the employee
https://api.smartsheet.com/2.0/search?query=10000
and the response of above call will have row id and again i should make a call with rowid to get that row by below call which I don't want.
GET /sheets/{sheetId}/rows/{rowId}
Can anyone help me out?
Although some folks do try to use Smartsheet like a database, it's not really designed to be queried via API in the same way that you'd use transact SQL to query a SQL database.
I don't believe the scenario that you've described (i.e., using the Smartsheet API to retrieve row(s) in a sheet where [column value] = [specified value]) is possible. Instead, you'll have to use the API to get the data in the sheet (Get Sheet) and then in your code, query the data that you received in the API response (to identify the row(s) that match your query criteria).

Joining two tables and fetching records in a single query in FQL

Hi i have written a query by which i can fetch posts,actor_id,comments and other columns required from stream table. But i want to fetch user's name also along with actor id and other columns in a single query.
My queries is :
select message,created_time,actor_id,attachment,comments,created_time,impressions,likes,message,message_tags,place,share_count from stream where source_id in (any_page_id)
I want to add user's name also from user table along with this list of columns i am fetching from stream table in a single query so that i can handle it in a single json file. .
Also in comments we will get several user's id with comments as from_id. Can we get username for this from_id also. Is this possible, i know we cannot use join in FQL. Or i am missing something or in a wrong approach. Please help me out. Thanks in advance.
Updated
Now i am able to get actor_id and other fields of the post together along with user's name at the end in the same json using multi-query. Something similar to :
fql?q={"query1":"select+message,created_time,actor_id,attachment,comments,created_time,impressions,likes,message,message_tags,place,share_count+from+stream+where+source_id+in(any_page_id)","query2":"select uid,name from user where uid in (*#query1* "}
But now i am not able to get the user's name and user's id who are there in the comments of the post in the same json.