Home Analyst Portal
Options

Saved Searches and AssignedTo

Olivier_BarraudOlivier_Barraud Customer IT Monkey ✭
Hello dear reader,

I upgraded to latest version (7.2.2012.1) a couple days ago.
All went well during upgrade of our two Cireson boxes. I had tested this twice before to perform on Prod.

We then discovered a bug in the My Searches functionality.

Let's imagine you perform a Work Item Search, Search All Work Items type, only one filter group, one filter saying Assigned To = <Analyst_Name> (indeed it's me for the example) ; click search, got results without issues.

WebConsole.log in DEBUG mode shows the query:

DEBUG [  23]:  Parameterized Search SQL:  SELECT WorkItem.* FROM WorkItem  LEFT JOIN Affected_CI$WorkItem_ConfigurationItem ON WorkItem.Id = Affected_CI$WorkItem_ConfigurationItem.WorkItemId LEFT JOIN Related_CI$WorkItem_ConfigurationItem ON WorkItem.Id = Related_CI$WorkItem_ConfigurationItem.WorkItemId LEFT JOIN WatchList ON WorkItem.Id = WatchList.WorkItemId WHERE (((AssignedUserId = @param0))) UNION SELECT WorkItem.* FROM WorkItem  LEFT JOIN Affected_CI$WorkItem_ConfigurationItem ON WorkItem.Id = Affected_CI$WorkItem_ConfigurationItem.WorkItemId LEFT JOIN Related_CI$WorkItem_ConfigurationItem ON WorkItem.Id = Related_CI$WorkItem_ConfigurationItem.WorkItemId LEFT JOIN WatchList ON WorkItem.Id = WatchList.WorkItemId INNER JOIN Reviewer_WorkItem_CI$User ra ON WorkItem.Id = ra.WorkItemId WHERE WorkItem.ClassId = @SystemWorkItemActivityReviewActivity AND (((AssignedUserId = @param0)))
DEBUG [  75]:  Parameterized Search Parameter:  Key: param0  Value: e78b47ef-e0ba-b30f-1b92-c2529c7a46f4
DEBUG [  75]:  Parameterized Search Parameter:  Key: UserId  Value: e78b47ef-e0ba-b30f-1b92-c2529c7a46f4
DEBUG [  75]:  Parameterized Search Parameter:  Key: SystemWorkItemActivityReviewActivity  Value: bfd90aaa-80dd-0fbb-6eaf-65d92c1d8e36

And a trace running on SQL shows the same.

Let's imagine you click on Save As, give a name to your query and click again Save As.
We could see that the query builder does its job, and the WI search is well stored in the ViewPanel table where we can read:

{
  "Id": "3926c305-9ea0-4ea2-9dab-40cd66dabcb6",
  "type": "queryBuilder",
  "content": {
    "configurationName": "workItemConfig",
    "query": [
      {
        "sectionTypeName": "ALL",
        "displayName": "All Work Items",
        "classId": "",
        "criteriaRoot": {
          "groupOperator": "And",
          "items": [
            {
              "field": {
                "name": "AssignedUserId",
                "displayKey": "AssignedTo",
                "fieldType": "user",
                "templateValue": "",
                "displayName": "Assigned To"
              },
              "operator": "eq",
              "value": {
                "userValue": {
                  "Id": "e78b47ef-e0ba-b30f-1b92-c2529c7a46f4",
                  "Name": "<Analyst_Name>"
                }
              },
              "type": "criteria",
              "groupId": "580a3a50-dc1c-465e-99a7-39cce07d2edf",
              "sectionId": "692bf079-00ef-a1cb-ad01-c5e1c922997b",
              "sectionTypeName": "ALL",
              "showCriteriaControl": true,
              "guid": 284
            }
          ],
          "type": "criteriaGroup",
          "sectionId": "692bf079-00ef-a1cb-ad01-c5e1c922997b",
          "sectionTypeName": "ALL"
        },
        "sectionId": "692bf079-00ef-a1cb-ad01-c5e1c922997b"
      }
    ],
    "navigationNodeId": "05dd2c16-0f91-4d83-99be-f21c9ec3e163"
  }
}


Then, here comes the drama. As soon as you click Save, and each time you call this search back, it's played again with the query stored in the table, but fails with the following errors:

DEBUG [  78]:  Parameterized Search SQL:  SELECT WorkItem.* FROM WorkItem  LEFT JOIN Affected_CI$WorkItem_ConfigurationItem ON WorkItem.Id = Affected_CI$WorkItem_ConfigurationItem.WorkItemId LEFT JOIN Related_CI$WorkItem_ConfigurationItem ON WorkItem.Id = Related_CI$WorkItem_ConfigurationItem.WorkItemId LEFT JOIN WatchList ON WorkItem.Id = WatchList.WorkItemId WHERE (((AssignedUserId = @param0))) UNION SELECT WorkItem.* FROM WorkItem  LEFT JOIN Affected_CI$WorkItem_ConfigurationItem ON WorkItem.Id = Affected_CI$WorkItem_ConfigurationItem.WorkItemId LEFT JOIN Related_CI$WorkItem_ConfigurationItem ON WorkItem.Id = Related_CI$WorkItem_ConfigurationItem.WorkItemId LEFT JOIN WatchList ON WorkItem.Id = WatchList.WorkItemId INNER JOIN Reviewer_WorkItem_CI$User ra ON WorkItem.Id = ra.WorkItemId WHERE WorkItem.ClassId = @SystemWorkItemActivityReviewActivity AND (((AssignedUserId = @param0)))
DEBUG [  78]:  Parameterized Search Parameter:  Key: param0  Value: 
DEBUG [  78]:  Parameterized Search Parameter:  Key: UserId  Value: e78b47ef-e0ba-b30f-1b92-c2529c7a46f4
DEBUG [  78]:  Parameterized Search Parameter:  Key: SystemWorkItemActivityReviewActivity  Value: bfd90aaa-80dd-0fbb-6eaf-65d92c1d8e36
ERROR [  78]:  Error executing GetGridWorkItemsAdHocAsync: 
System.Data.SqlClient.SqlException (0x80131904): Conversion failed when converting from a character string to uniqueidentifier.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows)
   at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more)
   at System.Data.SqlClient.SqlDataReader.Read()
   at Cireson.ServiceManager.DAL.Database.<ReadFromParameterizedSql>d__32`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Cireson.ServiceManager.Services.Implementations.WorkItemGridService.<GetGridWorkItemsAdHocAsync>d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CiresonWebConsole.Controllers.SearchController.<GetAdHocResults>d__14.MoveNext()
ClientConnectionId:05891efc-5a3b-464e-b2ed-fa60b12531fc



As one can see, the param0 value is absent, and of course no results are displayed.
Moreover, when we click on Edit to look at the search definition, the field where there was the name of the analyst is now empty. All shows that the Portal is unable to reclaim the Id, indeed well saved in the query in the ViewPanel.

All other searches' paramX are correctly retrieved, only those involving UserId get back to blank.

Am I the only one facing this? I didn't find any related issue neither in the forums nor on Google.

Thank in advance for your replies.

Best Answer

Answers

  • Options
    Olivier_BarraudOlivier_Barraud Customer IT Monkey ✭
    Hello Tony,
    Thank you for having checked this out !
    Looking forward to hear from the dev team. 
  • Options
    Bryan_SchrippeBryan_Schrippe Premier Partner IT Monkey ✭

    Hey Everyone,

    I have just installed the latest version of the portal at a client, v799, and we are running into this same issue.  When you create a search with a given criteria, did same test as above, when you save it returns 0 results, and when you try to edit the query the name is removed.  It will be interesting to see if this will be fixed in the next hotfix.  If the dev's have any idea as to what is going on please let me know.

    Thanks,

    Bryan

Sign In or Register to comment.