Workflow Soluiton

 View Only
  • 1.  HOWTO Print items from Array in Edit Ticket Component

    Posted Aug 21, 2009 03:50 PM
    I currently have an array that holds requested items for ordering. Currently I have a loop componenet that goes through the items in the array and then merges these items togethe rinto one text variable so that I can use that variable to list items requested in thte altiris ticket, the problem is that whenever I do this, everything prints out on one line. I tried using the html new line character but it doesnt work. I can see the little squares but when it adds the comment to the ticket everything is still bunched together, Does anyone have an alternative to printing the contents of an array into a ticket and format the contents? Thanks for any help.


  • 2.  RE: HOWTO Print items from Array in Edit Ticket Component

    Posted Sep 02, 2009 07:10 PM
    We've run into the same problem. I built a component that will allow you to pass in a delimited string and ticket number. The delimeter gets translated into carriage returns to allow you to format the ticket details. I've been meaning to post the solution for quite a while now. I'm sure you'd rather not wait, so if you want to email me offline, I can send it to you.


  • 3.  RE: HOWTO Print items from Array in Edit Ticket Component

    Posted Sep 11, 2009 12:46 PM
    Can you post it here? I'd like to see how you did that. I think we can modify that to format helpdesk comments when we display them in a webform.

    Thanks,
    rob
    rob.moore@travelport.com



  • 4.  RE: HOWTO Print items from Array in Edit Ticket Component

    Posted Sep 23, 2009 03:28 PM

    Pretty simple really, I just created a SQL script component that overwrites the comments of the most recent version of an incident. The SQL is as follows:

    update workitem set comment = (replace(@comment, @delimeter, CHAR(13))) where id = (select max(id) from workitem where number = @incident)

    The component ends up looking like this:

    formatComments.JPG

    So then, all you have to do is loop through your array/collection of text, and use a merge text component to tack on each element to a variable. Simply append whatever character you want to use as a line feed delimeter to the end of each element (or wherever you want to put them). Once you have built your new string with delimeters, you will need (very important!) to use either the create new incident, or edit ticket components BEFORE you use this new component - because as I said, it overwrites the most current version of the ticket. Obviously in the case of a new ticket, it has to exist before you can update it, and you typically don't want to overwrite the current version unless you know what is in it. I just use the edit or create components and don't bother setting anything in the comments. When the 'format comments' component runs, it will insert line feeds in place of the delimeter you choose. I should have time to make a proper post of this soon, but that's essentially all you need.