hi
there is a question about i want to get current jobID and robotName from studio
without calling orchestrator api
because execution log file has all these default logs
so i think there might be a way to get jobID and robotName
please help me , tks
Hello,
For the machine name : Environment.MachineName but i donât know with the JobID
Hi
Welcome to UiPath community
We can use Get Environment Variables activity to get,
- MachineName
- UserName
And to get the JobId
Kindly have a view in this
I havenât used this, but letâs give a try
Cheers @suzchang
thanks for your reply
but i have already seen this article
UiPath.Executor.ExecutorManager.Instance.Id.ToString()
cannot work
it will return exception â âExecutorâ is not a member of âUiPathâ
and the other way is calling orchestrator api
but i have more than one robot is running, calling orchestrator api is not adoptable for me
do u have another suggestion? tks
Is there a solution yet?
Hi @neriaa, welcome to forum did u tried orchestrator API ?
Hi Nived,
Thank you for the reply.
As far as I understood, Orchestrator API method gets the Job Ids of the Jobs that are currently Running on the specific machine, but not necessarily the JobId of the current Job. Is this correct?
Iâm afraid it could cause problems if more than one Job will be running on the same machine. Is it possible? and if so, is there an alternative solution?
Hi
Could you find any solution?
Thanks
I know this is an old thread, but I figured I would add a current solution. Runtime Activities will help solve this problem.
The following are available:
- GetProcessName: Retrieves the name of the process. If running from Studio, this will be the project name. If running via Orchestrator, this will get the process name as defined in Orchestrator.
- GetProcessVersion: Retrieves the version of the process (as defined in the processâs project.json file)
- GetJobID: Retrieves the unique ID of the process. This job ID also appears in the execution logs.
- GetInitiatedBy: Retrieves the means by which the process has been started. Can be StudioPro, StudioX, Assistant, Orchestrator
- GetWorkflowFilePath: Retrieves the path of the file that is currently executed.
Update. This wont return you a JOB ID. It returns job key, wich can help you to get ID of the job. Example of return value is âf942c40f-fd5c-48dd-bde1-3c78252c8ca6â, you can also verify this with swagger.
To get ID of job (for example to get logs for this job via API request) use this value with OData filter âKey eq f942c40f-fd5c-48dd-bde1-3c78252c8ca6â (i used my job-key). That will return you a job frow wich you can take an id of it.
Here is the ID;