cancel
Showing results for 
Search instead for 
Did you mean: 

Script to change owner/user of Job Definition in CPS

Former Member
0 Kudos

Hi,

We are looking for the script which can change the user/owner of the job definition, by default when ever we create/import any job definition in CPS it adds the user in "Security Tab" along with Grant-All and Grantable-All permissions and it will be grayed out and no changes allowed to that object owner/user.

We have requirement to change the owner/user of the job definitions. Can any one provide the cps script logic to update user/owner.

Thanks

Nidhish

Accepted Solutions (1)

Accepted Solutions (1)

gmblom
Active Contributor
0 Kudos

Hello,

This is not possible. The security model does not allow to change the owner of an object.

The only thing you can do is drop it and import it with a different user.

Regards Gerben

Former Member
0 Kudos

Hi Blom,

Thanks for the input,

In production we imported all the Jobs with Named User with Full Access and all the jobs were working fine.

Recently Named User moved to different project and we removed the access and all the jobs/triggers started failed with Access issue. (error log is attached)

Its issue with triggers (triggers are using Job-definition owner for update/edit/submit) Also on disabling the trigger its works fine

And we figured since all the Jobs are under him we are getting this issue.

So now we need a way to update / change the owner/user for all the jobs.

Can you please suggest some other way of doing it, apart form Export and import as it is not feasible in Production environment

Thanks

gmblom
Active Contributor
0 Kudos

Hello,

Here are some other options:

1) Easiest: add the roles back to the user in UME, import the user, revoke the roles again from UME (now dont touch the user anymore), what you can do is disable the user to prevent login.

2) Better: on the job definition on change action set the Action Subject user to another user with the correct privileges. If this is set, it overwrites the definition owner.

Regards Gerben

Former Member
0 Kudos

Awesome thanks dude

2nd Option works for me

former_member206885
Participant
0 Kudos

Hi Blom,

I am sorry to reply to the closed thread.

Is this need to be done for each and every scheduled job to switch the user?. Can it be done globally to change the user of all scheduled jobs?. Please advise?

Thanks,

Tinku

gmblom
Active Contributor
0 Kudos

Hello,

This is only required on the job definitions that actually have an action defined.

Regards Gerben

Answers (0)