7 Replies Latest reply on Mar 20, 2017 2:54 PM by wamccoid

    System Query Drop Down Selections and Filters

    tbuchanan Apprentice

      I am trying to modify the System Query 'Incident Search' to allow the user to select a Support group from the Query properties. I can do this by adding 'Current Assigned Group' as an attribute but it will just be a blank text box with no drop-down functionality for folks to look at the list of support groups. Is there a way to make it work this way? I see that other attributes are shown as drop-downs and I am trying to figure out what makes them that way. Currently the attribute that is in use on the search is 'Last Assignment Group.' This does display as a drop-down, but it contains not just support groups, but Suppliers as well. If it is not possible to make 'Current Assigned Group' a Drop Down, is there a way to filter 'Last Assignment Group' to only display Support groups? Any help is greatly appreciated. Thank you!

        • 1. Re: System Query Drop Down Selections and Filters
          motaz.alqaissi ITSMMVPGroup

          Hi,

           

          Thinking of it, I would do the following:

           

          NOTE: TAKE A BACKUP BEFORE APPLYING THE BELOW

           

          Link System>Group>Support Group to Incident Management>Incident (One to one relationship)

           

          Link System>Group>Support Group to Incident Management>Assignment (One to one relationship)

           

          Then add the new support group field into the assignment window and remove the group field. Then apply the following calculation on the attribute "Current Assigned Group" which is under Incident Management>Incident:

           

          import System

          static def GetAttributeValue(Incident):

                Value = ''

                Assignment = Incident.Assignments.Latest()

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

                return Value


          Once this is done, Go to your Incident search query and add the Support Group into the criteria.

          • 2. Re: System Query Drop Down Selections and Filters
            tbuchanan Apprentice

            I went through this step by step (very easy to follow, BTW) and unfortunately it never pulls any kind of result when I use it to search. I went back to the assignment window and made sure I had replaced the group field that originally existed and my changes had stuck, so I am not sure why it's not pulling back any results. Unfortunately I don't think this approach will work for us anyway because it would not update older Incidents and anything that was submitted prior to promotion of this change would no show up if this new attribute was used to search. I am thinking that the solution I desire might not be possible without a working filter on the existing attribute.

            • 3. Re: System Query Drop Down Selections and Filters
              motaz.alqaissi ITSMMVPGroup

              We can work around this by applying a script to copy the old data into the new field on the SQL Database. Because the same old values do exist in the new Support Group field so it should it

              1 of 1 people found this helpful
              • 4. Re: System Query Drop Down Selections and Filters
                wamccoid Specialist

                You are simply using the wrong attributes in your query.  You are using the Calculated String attributes "Current Assigned Analyst" and "Current Assigned Group"  note that these are simply string fields that are calculated and will never show as a dropdown.  Therefore, you should be using in your query criteria, Current Assignment->Group and Current Assignment->User.  Then it will display as a dropdown.

                 

                Best Regards,

                Will McCoid

                Lead ITSM Consultant

                NCSI

                • 5. Re: System Query Drop Down Selections and Filters
                  motaz.alqaissi ITSMMVPGroup

                  Hi,

                   

                  I wanted to suggest that at the beginning but I noticed that the current assignment > Group is listing all of the group in my environment. That's why I think using the Support Groups is a good solution for this.

                  • 6. Re: System Query Drop Down Selections and Filters
                    JonC Apprentice

                    Hi Tim,

                     

                    I believe that you can accomplish this by relating Support Group to the Incident Object. The subsequent field created would then be set as a calculation that will grab the latest assigned group from the most current assignment. I would use a couple of if statement to make sure that the latest group is set to avoid errors with the calculation. Since this field is based on Support Group instead of Group, it should be narrowed down to the groups that you are looking for. The calculation would be set as a Before Save calculation, this will work for all newer Incidents. To set this field for all previous Incidents, I would set the calculation as scheduled and run it one time. That scheduled calculation could take some time to run depending on how many Incidents you have. Once it has completed, you can delete the schedule and set the calculation back to Before Save.

                     

                    Best,

                    Jonathan Cooke

                    ITSM Consultant

                    NCSI

                    • 7. Re: System Query Drop Down Selections and Filters
                      wamccoid Specialist

                      I overlooked the part where it is showing suppliers as well.  I would do exactly what Jonathan says to do.  Will work fantastic.

                       

                      Will