10 Replies Latest reply on Jan 6, 2011 8:26 PM by SBW

    Latest Assignment User

    gramsay Specialist

      I have Latest Assignment Group - but no Latest Assignment user.

      How can I add the Latest Asignment User attribute to the process object? Is it possible?

        • 1. Re: Latest Assignment User
          Apprentice

          I may be way off here on what you're trying to do but could you not add this from 'Latest Assignment'?

           

          Ending up with something like 'Latest Assignment.User.Title' for example?

          • 2. Re: Latest Assignment User
            gramsay Specialist

            Unfortunately that doesn't work Darren. Window Manager won't display attributes of related-related objects.

            There is a workaround to get the group & user on the main Incident window but that doesn't work in WebDesk.

            The new Group attribute works fine but there doesn't appear to be a corresponding User attribute.

            • 3. Re: Latest Assignment User
              Stu McNeill Employee

              Hi Graham,

               

              The Latest Assignment Group relationship was added as part of the data partitioning functionality - it is used by the system to determine who is allowed to view an incident.  It is however also handy to use on the incident window as you've discovered.

               

              An alternative way to achieve this (and is included in the OOTB database as standard) is to create a calculation attribute on Incident to hold the current assignment user/group details which is then possible to add to the incident window as a read only field.  It happens that the OOTB calculations had some issues so there is a document on community with the fixed versions and instructions for implementing them here: The Current Assignment Group and Analyst attributes show no or old data.  The two attributes it refers to are called Current Assignment Group and Current Assignment User, they are both String attributes with a length of 100.

               

              Hope that helps!

              • 4. Re: Latest Assignment User
                gramsay Specialist

                Thanks Stu.

                It would be good to have these on the process object so that they can be used for:

                 

                Incidents

                Incident Tasks

                Changes

                Change Tasks

                 

                Or will I have to create them in the 4 seperate objects?

                • 5. Re: Latest Assignment User
                  Stu McNeill Employee

                  Hi Graham,

                   

                  I can't see why not, the Assignments collection appears on the Process object so you can get to the data and set the dependency.  Let me know if you have any issues because we'll soon start working on OOTB database changes for the 7.4 release and altering these with the correct formula is on the list.  We may decide to follow your lead...

                   

                  Thanks

                  • 6. Re: Latest Assignment User
                    gramsay Specialist

                    Seems to work with one exception.

                    If the Assignment is to the group only then the previous analyst value is not cleared.

                     

                    This is the calc for analyst:

                    import System
                    static def GetAttributeValue(Process):
                    Value = ''
                    Assignment = Process.Assignments.Latest()
                    if Assignment.User != null: Value = Assignment.User.Title
                    return Value

                     

                    Dependencies:

                    Assignments/User

                    Assignments

                     

                    • 7. Re: Latest Assignment User
                      Stu McNeill Employee

                      Hi Graham,

                       

                      I've had a quick look at this and its possible but the dependencies are causing a bit of confusion internally.

                       

                      Normally the only dependency you'd need is the name of the collection - "Assignments".  However the Assignments collection exists on all the child objects of Process as well as on Process itself (you can't see them but they have seperate entries in the metadata), and the dependency stored with the calculation is specifically the collection on Process.  This means the calculation isn't triggered when the Assignments collection on Incident, Problem, etc is used.

                       

                      In your case you'd also added "Assignments/User" as a dependency which works (the collection may be different between the objects but the attributes on the other end are still the same), but this will only trigger the calculation if the User is set.

                       

                      The solution is to use an attribute on Assignment which will always be populated as the dependency, I used "Assignments/CreationDate" and now it works great .

                       

                      Hope that helps.

                      • 8. Re: Latest Assignment User
                        gramsay Specialist

                        I thought it may have something to do with the dependencies. Nice work.

                        Here is a summary for future reference.

                         

                        Two new calculated attributes on the process object - "Calculated Assignment Group" & "Calculated Assignment User".

                        Data Type - String, Max Length 255

                        Calculation Type - "Before Save"

                         

                        For Group:

                         

                        import System

                        static def GetAttributeValue(Process):

                        Value = ''

                        Assignment = Process.Assignments.Latest()

                        if Assignment.Group !=null: Value = Assignment.Group.Title

                        return Value



                        Dependencies:

                         

                        Assignments

                        Assignments/CreationDate




                        For User:

                         

                        import System

                        static def GetAttributeValue(Process):

                        Value = ''

                        Assignment = Process.Assignments.Latest()

                        if Assignment.User != null: Value = Assignment.User.Title

                        return Value



                        Dependencies:

                         

                         



                        Assignments

                        Assignments/CreationDate

                         

                        Tested on:

                        • Incident
                        • Incident Task
                        • Change
                        • Change Task

                         

                        Works on both console and WebDesk windows.

                         

                        The Calculation Type can be temporarily set to "Scheduled" and a scheduled update run to update existing processes.

                        Jobs a good 'un. Thank you very much.

                        • 9. Re: Latest Assignment User
                          JulianWigman Expert

                          Thanks everyone,  I've set this up too and it works really well.

                           

                          J

                          • 10. Re: Latest Assignment User
                            ProServices

                            Just wanted to say thanks as well.  The first calculations I had setup for Current Assigned analyst and Current Assigned group did not work at all times.  I applied this and scheduled it and the current assigned analysts seem to be working.