SMA SQL: Subcategory question
Scenario: Rule changes the title of a service desk field if the character limit exceeds 50. I want the new field to read the category name and/or the category name plus something else. Now I have gotten that working, but it is not able to read subcategories. For example, if the category is "Microsoft:: Windows::Office" then the SQL will only change it to "Microsoft::" So how can I get it to show all of the subcategories? My SQL here: https://pastebin.com/Mmqx7hd5
Answers (1)
Because of what you are saying it is doing, it is possible that SQL is reading the commas as part of the set statement? As you can pass comma separated values to SET, so maybe try:
SET (HD_TICKET.TITLE = CONCAT(HD_CATEGORY.NAME, ' : Test'))
if not an alternative syntax for that line could be:
SET HD_TICKET.TITLE = HD_CATEGORY.NAME + ' : Test'
Not sure what else to try.
Comments:
-
Well I have learned how to use concat to pass CSV, but the HD.CATEGORY.NAME only shows the top level category. What's more, it is showing our default category (Account::) rather than whatever the true category is. So another problem. - walkerl 1 month ago
-
If you query your DB (I do this in a table query "report" and run as HTML - just make sure to use LIMIT if you select *) does it also only show top level for HD_CATEGORY.NAME? If it shows the whole thing it shows there must be something incorrect with the query. Mine certainly shows the whole thing meaning I'd drill down on the UPDATE part as to the source of the problem. - Michelle.ashby 1 month ago
-
I think my SQL is calling the name of the available categories rather than the name of category chosen on the actual ticket I am working on. I am not sure how to format that to work correctly. I also have a goal of having a ticket rule append the excessively long ticket title into the ticket summary or new comments automatically and then change the title. I have not found a way to make that work. - walkerl 1 month ago