PLM 360 IdeaStation
Share your wish list directly with the Autodesk PLM 360 Development Team
2 Kudos
jamest

Enable scripting to add additional owners

Status: Duplicate
by jamest on ‎12-20-2012 09:04 PM

Hi All,

I am not sure if this has been mentioned yet.

Currently your outstanding tasks will show anything that you have the ability to change, this means that there is WAY too many items in the list then is relevant.

My solution would be to allow a script to run (on item creation although doesn’t really matter) that would take the information from a user pick list field (let’s call it Assigned to) and add that person to the additional owners of the item.

Then in the security settings do not give your users access to see items owned by others and hence leaving you with an outstanding items list that is relevant to you not your entire team.

I understand that I could just add them into the additional owners manually however this is extremely frustrating as there is nothing to prompt you to do so and is often forgotten, if it is a field then I can make it required.

 

Please!!! :smileyhappy:

 

James

Status: Duplicate

New Properties

  • item.master.owner  
  •  
    • User (the owner of the item)
    • Now Modifiable (previous versions it was just readable)
  • item.master.additionalOwners
    • an array of Users
    • readable and modifiable as a normal array 
  • item.master.groupAdditionalOwners  
    • an array of Groups
    • readable and modifiable as a normal array

 

     N.B. item.master, and item.master.owner already existed, but don’t appear to be documented.

 

New functions

  • Security.loadGroup(String)  
  •  
    • Loads a group by its name

Examples

 

 

Make current user an additional owner

 

 

     var currentUser =Security.loadUser(userID);

 

     item.master.additionalOwners.push(currentUser);

 

Make QA group an additional Owner

 

 

     var qa group = Security.loadGroup('QA’);

 

     item.master.groupAdditionalOwners.push(qa);

 

Make ‘bob’ owner:

 

     item.master.owner=Security.loadUser(‘bob’);

 

 

Comments
by Employee on ‎01-27-2013 09:04 PM
Status changed to: Comments Requested
This has been on my personal wish list for a while, let's see if we can get some movement on this!
by Employee ‎04-08-2013 07:43 AM - edited ‎04-08-2013 07:45 AM
Status changed to: Duplicate

New Properties

  • item.master.owner  
  •  
    • User (the owner of the item)
    • Now Modifiable (previous versions it was just readable)
  • item.master.additionalOwners
    • an array of Users
    • readable and modifiable as a normal array 
  • item.master.groupAdditionalOwners  
    • an array of Groups
    • readable and modifiable as a normal array

 

     N.B. item.master, and item.master.owner already existed, but don’t appear to be documented.

 

New functions

  • Security.loadGroup(String)  
  •  
    • Loads a group by its name

Examples

 

 

Make current user an additional owner

 

 

     var currentUser =Security.loadUser(userID);

 

     item.master.additionalOwners.push(currentUser);

 

Make QA group an additional Owner

 

 

     var qa group = Security.loadGroup('QA’);

 

     item.master.groupAdditionalOwners.push(qa);

 

Make ‘bob’ owner:

 

     item.master.owner=Security.loadUser(‘bob’);

 

 

by jamest on ‎04-28-2013 12:17 AM

i am just following up on these examples,

i have been able to get the first one to work (userID), havent tried the second, however it the third one that bothers me.

it is my understanding that i need to get the user as an "object"

what i really need is to use a pick list and add additional owners based on that picklist selection, i dont really see the point if i cant do that.

 

Thanks 

James

 

by bentup on ‎09-26-2013 06:14 PM

I got the following script to update an item's owner by leveraging the Users, ALL by Name picklist in my PROJECT_OWNER field.  The complexity is due to loadUser using the Autodesk ID, but the picklist using user actual names.  The search allows for a first and last name match.

 

var userName=item.PROJECT_OWNER; // Get the users
var nameArray=userName.split(", "); // Split the name of user in question 
var lName=nameArray[0]; // Last name
var fName=nameArray[1]; // First name
var userINFO = Security.searchUsers({lastName:lName, firstName:fName}); //Find the user
item.master.owner = Security.loadUser(userINFO[0].id);  //Changes owner to user.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
IdeaStation Guidelines
Review guidelines and best practices
before posting a new idea


PLM 360 Survey