Cireson Partners, Customers and Community members share your customizations and examples here to help benefit the community as a whole to earn Kudos and badges.

DISCLAIMER

All files and projects located here are provided and come "as-is" and without any warranty or support. Use at your own risk. Your use of Community Uploads is subject to our Terms of Use.

Cireson does not and will not support or maintain these enhancements, extensions, and scripts.

For Team Cireson uploads click here.

Custom single work item edit url for all types

Martin_BlomgrenMartin_Blomgren Customer Ninja IT Monkey ✭✭✭✭
Service Manager isn't always the most versatile servicedesk system when it comes to notifications. Many of you probably have a subscription on new analyst comments using 'Trouble Ticket Analyst Comments' class (don't forget to filter on 'Is private'!) which is nice as it covers more work items types. The problem is to include a link in the template to the work item, rendering it somewhat useless.

Using Cireson (undocumented) API we can actually get around this problem with a small custom solution. Point the user to the custom url http(s)://portal/CustomSpace/EditWorkItem.html?id=WORKITEMID which will fetch the correct url and redirect the user.




Tested with IE11, Chrome 55, Firefox 45 & Edge with windows authentication.

I've attached the files needed in a zip archive. To install just drop the files in CustomSpace and start using your new custom url.

Comments

  • Jonathan_BolesJonathan_Boles Customer Ninja IT Monkey ✭✭✭✭
    @Martin_Blomgren, you've made it Christmas all over again! Thanks for yet another great solution to enhance our capabilities with SCSM and the Cireson Portal!
  • Tom_HendricksTom_Hendricks Customer Ninja IT Monkey ✭✭✭✭
    I am now completely convinced that @Martin_Blomgren is a machine.  At least try make it look more difficult! :)
  • Conner_WoodConner_Wood Customer Advanced IT Monkey ✭✭✭
    Oh Yes, we've struggled with SCSM Notifications because the url had to contain the class name for the ticket which can't be grabbed dynamically through SCSM properties..... however with this.... I needed this months ago, hahahaha!
  • Candice_YeudallCandice_Yeudall Customer Advanced IT Monkey ✭✭✭
    Very nice thank you can't wait to play with this :)
  • Conner_WoodConner_Wood Customer Advanced IT Monkey ✭✭✭
    Congrats on getting Cireson to use your custom solution!  However because Cireson doesn't use Windows Authentication (which makes sense) if you haven't logged into the Cireson Portal then the page won't load or go anywhere:

    Ex. https://support.cireson.com/customspace/editworkitem.html?id=IR41207


    So perhaps evaluating if it fails and then redirect them to a hard-coded login link would be about the only way to improve this very much needed Portal add-on or perhaps even go the full way and the login link contains the page to go to after login for the 5 Ticket Types:

    Ex. https://support.cireson.com/Login/Login?ReturnUrl=%2fIncident%2fEdit%2fIR41207%2f

  • Martin_BlomgrenMartin_Blomgren Customer Ninja IT Monkey ✭✭✭✭
    edited February 2017
    @Conner_Wood noticed it yesterday as well :smile:, nice but with forms based auth it doesn't do any good.

    Some quick testing:
    - Customspace is not protected by forms based authentication, probably only the asp.net mvc controllers which serves content that is. This means that my script actually runs and I'm able to do something about it!
    - The 'ReturnUrl' query param accepts an url with queryparams as long as they are url encoded so this url works: https://support.cireson.com/Login/Login?ReturnUrl=%2Fcustomspace%2Feditworkitem.html%3Fid%3DIR41207

    With above in mind I could wrap something up so that when forms based authentication is used the login url is used instead.

    Another option would be for those using form auth to use the above url encoded url in their templates instead!

  • Conner_WoodConner_Wood Customer Advanced IT Monkey ✭✭✭
    That's a creative solution, but if someone is already logged in clicking that original link would force them to login again.....

    I agree that as a quick fix Cireson should update their email notification templates with that improved URL!

    If you can dynamically determine which url to use, maybe Cireson API allows you to tell if forms authentication is in use and if current person is logged in or not, your version of the url is definitely the way to go if it turns out they must login.

    I've found the best user experience is minimal effort required by the user.  Convenience.
  • Martin_BlomgrenMartin_Blomgren Customer Ninja IT Monkey ✭✭✭✭
    Attached an updated version with support for both 'Windows Authentication' and 'Forms Authentication'.

    Switched back and forth in my test environment between Windows- and Forms auth and tested with Chrome, Firefox, Edge & IE11 without any problem!
  • Joe_BurrowsJoe_Burrows Cireson Devops Super IT Monkey ✭✭✭✭✭
    Thanks Martin have just added this works great :)
  • Tom_HendricksTom_Hendricks Customer Ninja IT Monkey ✭✭✭✭
    Simple and effective.  Nice, @Martin_Blomgren!
  • TysonTyson Member IT Monkey ✭
    Martin-

    Fantastic, thank you!
  • Nick_FlintNick_Flint Customer Adept IT Monkey ✭✭
    Thanks for sharing this Martin.

    I prefix the work item id with DEV, TEST, or PROD based on the environment. I was trying to get this to redirect to the correct environment based on the work item id so I didn't have to change the url in every notification template after migrating from one environment to the other. No matter what type of javascript redirect I've tried to use I can't get it to open the work item.

    Do you have any ideas to make this work that way?
  • PIERRE-LOUIS_DURRISPIERRE-LOUIS_DURRIS Customer Advanced IT Monkey ✭✭✭
    edited July 2017
    @Martin_Blomgren  : thanks a lot. So easy to install and so easy to use in email template.
    Work with portal V8 and windows auth.

  • Karen_Bruster1Karen_Bruster1 Customer IT Monkey ✭
    Service Manager isn't always the most versatile servicedesk system when it comes to notifications. Many of you probably have a subscription on new analyst comments using 'Trouble Ticket Analyst Comments' class (don't forget to filter on 'Is private'!) which is nice as it covers more work items types. The problem is to include a link in the template to the work item, rendering it somewhat useless.

    Using Cireson (undocumented) API we can actually get around this problem with a small custom solution. Point the user to the custom url http(s)://portal/CustomSpace/EditWorkItem.html?id=WORKITEMID which will fetch the correct url and redirect the user.




    Tested with IE11, Chrome 55, Firefox 45 & Edge with windows authentication.

    I've attached the files needed in a zip archive. To install just drop the files in CustomSpace and start using your new custom url.

    I know this is old, but I am trying to implament this and not having any luck. Can some in give me an notification example?
    I am using SCSM Notifications with the following information for ID (<a href="http://servicedesk/portal/sitepages/my Requests.aspx?RequestId=$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Id$">$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Id$</a)
    Should I replace the entire line with your line?
    The portal path is ...CiresonPortal\CustomSpace , I have tried your example and it still does not show the ticket form
    Any assistance would be helpful as I have close to 40 notifications to modify

  • Tom_HendricksTom_Hendricks Customer Ninja IT Monkey ✭✭✭✭
    Where is the problem?  Are you able to get it to work when you type the URL directly into the browser, or not?  If it works in the browser's address bar, but not in the email templates, then I would check to see that your Alias of CustomSystem_WorkItem_Library matches the reference to System.WorkItem.Library in your management pack. 

    If you use Visual Studio Authoring Extensions (VSAE) to generate your management packs, there is one other potential issue:  If you store your HTML templates as resources in the management pack, rather than inputting them directly into the template wizard in the console, or including them directly inside the template object in the management pack, then VSAE might be tossing out your reference to System.WorkItem.Library if it does not see the alias used anywhere in your MP (because it is actually in your bundled HTML file).  An easy hack to fix this is to create a template that uses the reference anywhere, be it in the subject or body, in the text of the MP fragment.  You do not need to add a subscription to this template, or even specify any recipients; it just needs to exist so that the references are respected.

    If it does not work in the address bar of your browser, @Martin_Blomgren included some very precise instructions (which worked like a charm for our site), but it appears that you are using different folder and file names, and that is causing the issue.  That is not necessarily a bad thing to do, but it does mean that some translation is needed.

    If your portal is reached at http://myportal/ then you would make your URL's point to http://myportal/CustomSpace/EditWorkItem.html?id=IR12345.  If your portal is reached at http://myportal/portal/ then it would be http://myportal/portal/EditWorkItem.html?id=IR12345.  If you changed the name of Martin's file, then you would replace EditWorkItem.html with the new name.
  • Karen_Bruster1Karen_Bruster1 Customer IT Monkey ✭
    edited August 2017

    Where is the problem?  Are you able to get it to work when you type the URL directly into the browser, or not?  If it works in the browser's address bar, but not in the email templates, then I would check to see that your Alias of CustomSystem_WorkItem_Library matches the reference to System.WorkItem.Library in your management pack. 

    If you use Visual Studio Authoring Extensions (VSAE) to generate your management packs, there is one other potential issue:  If you store your HTML templates as resources in the management pack, rather than inputting them directly into the template wizard in the console, or including them directly inside the template object in the management pack, then VSAE might be tossing out your reference to System.WorkItem.Library if it does not see the alias used anywhere in your MP (because it is actually in your bundled HTML file).  An easy hack to fix this is to create a template that uses the reference anywhere, be it in the subject or body, in the text of the MP fragment.  You do not need to add a subscription to this template, or even specify any recipients; it just needs to exist so that the references are respected.

    If it does not work in the address bar of your browser, @Martin_Blomgren included some very precise instructions (which worked like a charm for our site), but it appears that you are using different folder and file names, and that is causing the issue.  That is not necessarily a bad thing to do, but it does mean that some translation is needed.

    If your portal is reached at http://myportal/ then you would make your URL's point to http://myportal/CustomSpace/EditWorkItem.html?id=IR12345.  If your portal is reached at http://myportal/portal/ then it would be http://myportal/portal/EditWorkItem.html?id=IR12345.  If you changed the name of Martin's file, then you would replace EditWorkItem.html with the new name.

    Sorry I wasn't clear, the herf I posted was the old one before @Martin_Blomgren change. Here is the one I changed it to:  (<a href="http(s)://<servername>/CustomSpace/EditWorkItem.html?id=WORKITEMID=$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Id$">$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Id$</a)
    It does work fine in the browser when typed in manually with the ticket number, but not when you click on it in the email. I did not make any changes to the System.WorkItem.Library management pack. I have had several people test it since I am an admin and everything always works for me, they are reporting the page not found error.

  • Martin_BlomgrenMartin_Blomgren Customer Ninja IT Monkey ✭✭✭✭
    @Karen_Bruster1, WORKITEMID is a placeholder for the actual ID. The url should therefor in your case be:

    (<a href="http(s)://<servername>/CustomSpace/EditWorkItem.html?id=$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Id$">$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Id$</a) 
  • Karen_Bruster1Karen_Bruster1 Customer IT Monkey ✭
    @Karen_Bruster1, WORKITEMID is a placeholder for the actual ID. The url should therefor in your case be:

    (<a href="http(s)://<servername>/CustomSpace/EditWorkItem.html?id=$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Id$">$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Id$</a) 


    Martin,
    Thanks was having a du moment.... Only problem is that we set the default page for the customer to the Home page and when they click on the link it takes them there. So I guess in a way its working. Any ideas on how to get around that?

  • Martin_BlomgrenMartin_Blomgren Customer Ninja IT Monkey ✭✭✭✭
    @Karen_Bruster1, strange if you or the user manually type the url and it works somehow the generated url from the notification must be something else. What exactly are the url generated by scsm? (please mask your domain if you dont want it public)

    Which class are you targeting by the way?
  • Karen_Bruster1Karen_Bruster1 Customer IT Monkey ✭

    @Martin_Blomgren, the class is Servcie Request (new ticket)

    This url takes you to the Home page of the portal https://servicedesk.xxxx.xxxxx.xxx/ServiceCatalog/Listing/#/

    Here is the template code I am using to point to the ticket ID

    <td bgcolor="white" colspan="2"><strong>Service Request ID:</strong> <a href="http://servername:80/CustomSpace/EditWorkItem.html?id=$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Id$">$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/Id$</a <br>

  • Karen_Bruster1Karen_Bruster1 Customer IT Monkey ✭
    @Martin_Blomgren Any further thoughts on what could be the issue? See Aug 7 post
  • Zackary_SlatesZackary_Slates Customer IT Monkey ✭

    Can I ask how you got the red bubbles on your left hand navigation?

  • Brad_McKennaBrad_McKenna Customer Adept IT Monkey ✭✭
    @Zackary_Slates See one of Martin's other threads for the Work Items Badge code/info:
    https://community.cireson.com/discussion/1632/active-work-items-badges-on-menu-items#latest
Sign In or Register to comment.