Home Community Uploads
image

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 expanded action log (comments)

2

Comments

  • Martin_BlomgrenMartin_Blomgren Customer Ninja IT Monkey ✭✭✭✭
    @Raffael_Jenzer, will look into this but we're currently not experiencing this problem in our production system and I have been using the community edition in my lab/dev environment which doesn't include the Send Email functionality. Will have that sorted out soon enough though!

    In the meanwhile which version of the portal are you using and are you using any other custom stuff? For example the custom apply I uploaded?

    For anyone interested the current inhouse revision of this custom actionlog is able to filter and hide service account entries OR rename the service account for one service account. Is there a need to utilize an array to filter multiple ones?

    Will try to fix the dual entry email problem and perhaps multiple service accounts before upload.
  • Raffael_JenzerRaffael_Jenzer Customer IT Monkey ✭
    @Martin_Blomgren, thanks for your answer and help. We're currently using the Version 7.2.2012.1. We will upgrade to the newest version until middle of March.

    Yes we're using a lot of custom stuff. We've had implemented your custom apply feature, but we recently disabled it, because it autosaved also after "Assign to Analyst by Group" and when other stuff was changed. Our analysts change a lot of fields together: Assigning to Analyst by Group, then Area, Priority etc... and at the end, they want to save (apply) the Request. That's why we disabled it.

    Thanks in advance,
    Raffael
  • Tim_VottaTim_Votta Customer Adept IT Monkey ✭✭
    @Martin_Blomgren, thanks a ton for releasing this.  I look forward to the changes for pulling out the service accounts as well.

    Thank you @Brian_Wiest for the additions as well.
  • Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭
    Just adding my input..
    While the service accounts entries are typically not the targeted line items analysts review, I still believe it is good to have there as it shows the workflow running request. What I have done was more customization of the scripts to make the default font smaller. The set a larger font and darker color and the comments lines along with marking private a different color. this leaves the workflow line items in the action log while making the comment entries stand out. My guess this is a personal preference. My "challenge" is 400 analysts all wanting different experiences.

  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    @Martin_Blomgren, thanks for your answer and help. We're currently using the Version 7.2.2012.1. We will upgrade to the newest version until middle of March.

    Yes we're using a lot of custom stuff. We've had implemented your custom apply feature, but we recently disabled it, because it autosaved also after "Assign to Analyst by Group" and when other stuff was changed. Our analysts change a lot of fields together: Assigning to Analyst by Group, then Area, Priority etc... and at the end, they want to save (apply) the Request. That's why we disabled it.

    Thanks in advance,
    Raffael
    I was going to comment on this, too.  Especially because my forms auto-filter the assignee list and users can sometimes click too fast and pick the wrong name, we do not want the form to save on assignee change.  A simple edit takes care of this.  Wrap everything inside of actionLog.bind("change", function(e) {} (starts line 44) in the following IF statement:

    <b>if (actionLog[0].Title !== "Record Assigned") {</b><br>  <i>[[EXISTING CODE, BEGINNING WITH app.lib.mask.apply(); ]]</i><br><b>}</b><br>

    I have tested this adjustment in 7.3.2016.  So far, no false positives or misses.
  • Martin_BlomgrenMartin_Blomgren Customer Ninja IT Monkey ✭✭✭✭
    @Brian_Wiest, once again great ideas for ui improvements! Do you care to share css and maybe a screenshot?

    @Tom_Hendricks, we don't load the custom auto apply script for analysts and end users interactions compared are very basic. That's probably why I didn't see this on our environment. Easily addressed as you've done already. Will post an update in the auto apply thread!

    For my custom work I see a problem and a solution, possible not the best solution as things could always get better, especially the visual things as I never done fronted until recently or stuff I cannot/didn't think of to test. I really want to encourage all of us who extend and improve all custom stuff uploaded here from me or anyone else to contribute your work back to the community. Demands are different in different organizations and hopefully the users here can find some lines of code that works magic their specific environment (@Brian_Wiest, 400 analysts, forget about magic ;))
  • Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭
    In truth its my plan but not reality yet. 
    Well we only have two people tasked to SCSM, me on the front and my teammate building a warehouse search portal. Alone with expanding our 40 support desks with another 100, it can be a nightmare tracing permissions or workflows when a specific analyst reports an error. 
  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    @Martin_Blomgren, your approach is spot-on.  I hope nobody expects any of the community-provided solutions to be perfect for all scenarios all the time.  Start with something that works for certain situations, and others can build on it.  So no need to explain, great stuff is getting built here!
  • Martin_BlomgrenMartin_Blomgren Customer Ninja IT Monkey ✭✭✭✭
    @Tom_Hendricks, wasn't as much as trying to explain but rather to encourage people to share, even in their eyes insignificant modifications or custom stuff as it could very well be just the thing needed by someone else!

    I agree the outcome of this community is great!
  • Leigh_KildayLeigh_Kilday Member Ninja IT Monkey ✭✭✭✭
    @Martin_Blomgren, we're using this and another solution of yours for WI preview forms. The latter allows line breaks for Action Log entries, but the former does not.

    How can I get the Custom Expanded Action Log to display line breaks?
  • Leigh_KildayLeigh_Kilday Member Ninja IT Monkey ✭✭✭✭
    edited March 2017
    @Martin_Blomgren, we're using this and another solution of yours for WI preview forms. The latter allows line breaks for Action Log entries, but the former does not.

    How can I get the Custom Expanded Action Log to display line breaks?
    Never mind. I've fixed it.

    At the end of custom_ActionLog.js, I've added a line to an existing rule.

    In the existing rule on line 127: addRule(".chat li .chat-body p", {
    Add a comma after the color line and add another line with "white-space": "pre-wrap"
  • Steve_ClarkeSteve_Clarke Customer Adept IT Monkey ✭✭
    Thanks for sharing that last piece @Leigh_Kilday. That works well.
  • Ralph_PalmerRalph_Palmer Customer IT Monkey ✭
    I have tried this out on our test environment and it works perfectly, but I noticed that when an incident or service request is finally closed it reverts back to the out of the box action log style. Any thoughts as to what might need chaging in the js.  Thanks.  Ralph
  • Ralph_PalmerRalph_Palmer Customer IT Monkey ✭

    Leigh,

    Thanks for the update. 

    I am new to both the Cireson Portal and JS, would the solution you propose for the "Task Menu" work for the Custom JS "Action Log"?  Or is it an absolue No when running Custom.JS on closed items?

    Ralph

  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    @Ralph_Palmer, I described a workaround in the threads @Leigh_Kilday mentioned, but I used technical language that assumes a good working knowledge of JavaScript and the way that the Cireson Portal loads its scripts.

    In an attempt to clear up some of my jargon:
    • Any code you write in the /CustomSpace/custom.js file always runs each time a page is opened in the portal
    • There is a KB article that explains the supported/recommended way of adding custom tasks or events that occur when the form loads or when a field's value changes: https://support.cireson.com/KnowledgeBase/View/52#/
    • However, nothing that starts with app.custom (like the KB article shows) will run when the ticket form you are opening has a status of Closed.  This is apparently by design, but many of us have requirements for code to run on the closed forms.
    • There are other ways to make your code run at the intended time, using more conventional JavaScript, but it is not as simple as the way that is recommended in the KB article above.
    I recommend taking a look at some of the other community content to see how others have made this work.  There are far more talented people than me in this forum who can simplify this even further perhaps, but I wanted to make an attempt to clarify things since you said that you are new to JS.  I hope this helps a little.
  • Adrian_MataiszAdrian_Mataisz Customer Advanced IT Monkey ✭✭✭
    edited May 2017
    How do I change the time format from military to US format AM/PM?   Thank You
  • Brad_McKennaBrad_McKenna Customer Advanced IT Monkey ✭✭✭
    Adrian, may want to try this...

    https://gist.github.com/hjst/1326755

    I'll be trying it tonight to validate as well
  • Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭
    Line 8 Update to
    var timeFormat = 'MM-DD-YYYY hh:mm A';
  • Adrian_MataiszAdrian_Mataisz Customer Advanced IT Monkey ✭✭✭
    @Brian_Wiest , I'll make the change. If I want to change the date format from "MM-DD-YYYY to "MM/DD/YYYY" can I just change the "-" to a "/" ?
  • Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭
    Change in my Lab and it worked as expected. Giving you the MM/DD/YYYY format.
  • Adrian_MataiszAdrian_Mataisz Customer Advanced IT Monkey ✭✭✭
    Thank you @Brian_Wiest . I'll give it a try. 
  • Adrian_MataiszAdrian_Mataisz Customer Advanced IT Monkey ✭✭✭
    @Brian_WiestLine 8 Update to
    var timeFormat = 'MM-DD-YYYY hh:mm A';
    Doesn't work for me.

    We get now for ex 16:31 PM 
  • Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭
    Working for me on IE11 and Chrome with Portal v7 with ENU set as the default Localization.
    Have you attempt to clear your local browser cache?
  • Adrian_MataiszAdrian_Mataisz Customer Advanced IT Monkey ✭✭✭
    edited May 2017
    I did. Maybe only old entries show like that. I don't have a test environment so I make changes to our live. I'll try again after 12PM CST and see if adding a comment will show the time correctly.
  • Leigh_KildayLeigh_Kilday Member Ninja IT Monkey ✭✭✭✭
    @Martin_Blomgren, we have an issue with this script, but mysteriously, only for some users, and only if there are no action log entries.
    1. An end user is a reviewer, and they follow the link provided in an email to approve the RA.
    2. The portal partially loads and the donut of death spins indefinitely.
      With the F12 menu up, we see:
      TypeError: comments is undefined in custom_ActionLog.js:72
    If we add an action log entry, the page renders properly.

    Do you have any suggestions?
  • Martin_BlomgrenMartin_Blomgren Customer Ninja IT Monkey ✭✭✭✭
    edited August 2017
    @Leigh_Kilday, test to add a conditional check around comment sorting and creating log entries (row 71-77):

    <div>if (comments != undefined) {<br>&nbsp; //sort comments<br>&nbsp; comments.sort(function(a,b) {return (b.EnteredDate > a.EnteredDate) ? 1 : ((a.EnteredDate > b.EnteredDate) ? -1 : 0);} );<span style="background-color: transparent; color: inherit; font-size: inherit; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;">&nbsp; //create log entries</span>
    </div><div>&nbsp; for (i = 0; i < comments.length; i++) {<br>&nbsp; &nbsp; html += GetCommentHtml(comments[i]);<br>&nbsp; }<br>}</div>

    When I pulled up the code for this customization I realized that I've added a feature to hide service account records which I haven't released. Will post an update in time..
  • Sam_Smith1Sam_Smith1 Customer IT Monkey ✭
    @Leigh_Kilday, test to add a conditional check around comment sorting and creating log entries (row 71-77):

    <div>if (comments != undefined) {<br>&nbsp; //sort comments<br>&nbsp; comments.sort(function(a,b) {return (b.EnteredDate > a.EnteredDate) ? 1 : ((a.EnteredDate > b.EnteredDate) ? -1 : 0);} );&nbsp; //create log entries
    </div><div>&nbsp; for (i = 0; i < comments.length; i++) {<br>&nbsp; &nbsp; html += GetCommentHtml(comments[i]);<br>&nbsp; }<br>}</div>

    When I pulled up the code for this customization I realized that I've added a feature to hide service account records which I haven't released. Will post an update in time..
    @Martin_Blomgren

    Thanks for the fix Martin, it's working for all users now. We also had to add the conditional in the CustomActionLogHandler function, around actionLog.bind as it threw an error after making the change you recommended. i.e:

    <div><span>if (actionLog != undefined) {</span><br>actionLog.bind("change", function(e) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; $('.chat').prepend(GetCommentHtml(e.items[0]));</div><div>&nbsp; &nbsp; });<br>}</div>
  • David_Morris1David_Morris1 Member Advanced IT Monkey ✭✭✭
    @Martin_Blomgren

    Thanks for this solution its works so much better than the out of the box action log, 

    I've noticed you've used the HTML "Editor" as the input box that allows rich input such as pictures,paragraphs, links,grids etc. but as this is saved into the action log as plain text is lost.

    would it be possible to have a version of the solution where the action log is saved into SCSM as raw HTML (would be nonsence in the console) but would publish out to the portal with all the features in tact
  • Giovanni_PeriniGiovanni_Perini Customer IT Monkey ✭
    @Leigh_Kilday, test to add a conditional check around comment sorting and creating log entries (row 71-77):

    <div>if (comments != undefined) {<br>&nbsp; //sort comments<br>&nbsp; comments.sort(function(a,b) {return (b.EnteredDate > a.EnteredDate) ? 1 : ((a.EnteredDate > b.EnteredDate) ? -1 : 0);} );<span style="background-color: transparent; color: inherit; font-size: inherit; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;">&nbsp; //create log entries</span>
    </div><div>&nbsp; for (i = 0; i < comments.length; i++) {<br>&nbsp; &nbsp; html += GetCommentHtml(comments[i]);<br>&nbsp; }<br>}</div>

    When I pulled up the code for this customization I realized that I've added a feature to hide service account records which I haven't released. Will post an update in time..
    Hi Martin,

    Thanks for this great work. 

    Do you have any idea when you would have time to upload the customization for hiding the service account records? 

    Thanks in advance,

    Giovanni
Sign In or Register to comment.