setting requestedFor and requestedBy when queuing a build through API

Anantha Prakash, Karthik 1 Reputation point
2022-10-20T17:55:50.73+00:00

hi,

I'm trying to use this API - https://learn.microsoft.com/en-us/rest/api/azure/devops/build/builds/queue?view=azure-devops-rest-7.1 to queue a build fr pipeline B from another pipeline A. I would like to set requestedBy and requestedFor when this build is queued. I tried passing these in request body
{
"definition": {
"id": some-id
},
"requestedFor": {
"displayName": "some-name"
}
}
In the build pipeline B that was queued, I printed the below value: $(Build.RequestedFor)
but I always see the dispslay name of the user I used when i made the API request. How do i override this to a user i want?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,987 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JananiRamesh-MSFT 22,711 Reputation points
    2022-10-20T18:08:25.46+00:00

    Hi @Anantha Prakash, Karthik Welcome to Microsoft Q&A! Thanks for posting the question.

    DevOps is currently not supported in the Q&A forums; the supported products are listed over here https://learn.microsoft.com/en-us/answers/products (more to be added later on).
    You can ask the experts in the dedicated forum over here:
    https://stackoverflow.com/questions/tagged/devops
    https://developercommunity.visualstudio.com/spaces/21/index.html

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    0 comments No comments