Hello again,
I'm assuming that the job you mean is the Update Earned Value and Cost Totals job, but that's a detail. In my system that has an internal Job ID of 5000046. Here is what I did.
1) Created a scheduled job for that job with no end date that runs on Sundays, with a start date in the future:
This scheduled job has an internal ID of 5042064.
2) Next I created a job process on the project object using the script you attached as the base, but with some minor changes. The main ones are the Job ID is picked up from a parameter and the Project ID is determined at run time, rather than hard-coding them. I've attached the script to this reply.
3) I opened the project, navigated to the processes tab and executed the process. The log looks like this:
Which suggests the process has scheduled the job.
4) I went into the Scheduled Job and navigated to the instances that have been executed and it looks like the job ran OK:
Is that what you need, or have I misunderstood?
Paul
Original Message:
Sent: Jan 12, 2022 06:17 AM
From: Jeevana Battu
Subject: How to run parametrized Job through a process?
Hi Paul,
1st hardcoded value - 5254330 , is the Scheduled job ID(we need to schedule 'Update cost Totals' job and give this ID in the script, so every time the process picks this Scheduled job and run it)
2nd hardcoded value - 5088731, is the Idea Internal id
Please let me know if you figure out things I am missing ?
Thanks,
Jeevana.
Original Message:
Sent: Jan 12, 2022 05:50 AM
From: Paul Schofield
Subject: How to run parametrized Job through a process?
Thanks for this. Let me adjust the identities etc., so I can try it on my system. Just to start things off though, what do the hard coded numbers represent? On my system that job has a job_definition_id of 5000046.
Paul
Original Message:
Sent: Jan 12, 2022 04:48 AM
From: Jeevana Battu
Subject: How to run parametrized Job through a process?
Hi Paul,
I am attaching the code here, I tried with Internal id, Project id and name as well. 'Update cost totals' job is running but not picking any parameter value.
Thanks,
Jeevana.
Original Message:
Sent: Jan 12, 2022 04:21 AM
From: Paul Schofield
Subject: How to run parametrized Job through a process?
Can you post the code so we can see what might be going wrong?
Paul
Original Message:
Sent: Jan 11, 2022 10:24 AM
From: Jeevana Battu
Subject: How to run parametrized Job through a process?
Hi,
I have a requirement where we need to run 'Update Cost Totals' job from a process where I should pass dynamic Project values in it.
I found something in communities but that is not picking dynamic Project Id.
Please help!!
Thanks,
Jeevana.