How to get a part of a Shared Schedule name in a variable

GuyS (45 posts)
November 20, 2019 07:38 AM
Accepted Answer

Easy one, for you:

 

I have a Shared schedule named RunJobClientA which has been added in Job GOFORIT as a trigger.

I want the first step to update a variable Client to the value of the last character of  ScheduleName (A in this example above) for that run.

I will have RunJobClientA, RunJobClientB, RunJobClientC, etc...….

I tried some systemvariables, but had no success until now.

 

Thanks,

Guy 

 

  

 

Bill Staff (599 posts)
November 20, 2019 07:06 PM
Accepted Answer

Not easy, in fact. There's no runtime variable that stores this information. The only way to get it would be to use the API to retrieve the job, look at its schedules, and find the Shared Schedule. But if a job has more than one schedule trigger, there would be no way to know which schedule triggered the job--this information isn't stored anywhere.

So if you've attached multiple schedules to a job, and you want the job to behave differently based on which schedule triggered it, that can't be done right now. Tell me more about what you're looking to accomplish, and we can maybe add the information in a variable. But it's not that simple, because the scheduling engine only keeps track of scheduled runtimes, not the source of those runtimes. And what would happen if two schedules produce the same runtime? adTempus only starts the job once in that scenario.

Replies are disabled for this topic.