Customising "Assigned to" Field

 
Author
Message
SysAider
29
 
We have implemented the SysAid Enterprise Version.
For all our administrators and users names we are using employee IDs (number) as user names.
We need to be able to display the first name along with user name in the assigned to field.
How do i go about implementing this?
Thanks in advance for all the help rendered.
SysAid Wiz
2449
 
Hello Harvinder

Is the first name and last name are written in the user's details?
Which version of SysAid are you using?

I think this feature has been introduced in version 5 and being done automatically.
Pushing IT forward
SysAid Wiz
915
 
No Haim... on the SR page yes... but on the SR list nope.
And there's no first name field user can add through customization.
SysAid R&D
4
 
I can help you ,but I need to know your database type
SysAid Wiz
915
 
Mine's Derby...
SysAider
29
 
Our Database is MS-SQL...

Our concern comes is when our users list out the SR generated by them, they get an Employee number in "Assigned to" field which is of no meaning to them, they want to be able to see a name to connect to in case they want to call up the IT dept and inquire about their open issues.

Thanks for any help to resolve this....
SysAid R&D
4
 
First of all, you need to create customColumns.xml file in SysaidServer/root/WEB-INF/conf directory.
The text in this file :
<?xml version="1.0" encoding="UTF-8"?>
<customColumns>

<customColumn>
<columnAccountID>free</columnAccountID>
<columnTable>sr</columnTable>
<columnAttributeName>assigned_name</columnAttributeName>
<columnCaption>Assigned To Name</columnCaption>
<columnScript><![CDATA[
def prID = rs.getString("r.responsibility");
def acc=rs.getString("account_id");
def stat = dbConn.prepareStatement("select first_name,last_name from sysaid_user ta where ta.user_name = ? and ta.account_id=? ");
stat.setString(1,prID);
stat.setString(2,acc);
def rss = stat.executeQuery();
def desc = "";
if (rss.next()) {
desc = rss.getInt(1);
if (desc!=null)
desc=desc+" "+rss.getInt(2);
else
desc=rss.getInt(2);
}
rss.close();
stat.close();
return (desc!=null ? desc : "");
]]></columnScript>
</customColumn>
</customColumns>

After finishing this please replace in the columnAccountID tag in the word 'free' with your account name,save the file and restart sysaid.After restarting the new column named 'Assigned To Name' appears in columns list when you customizing your list .all you need to do is to add this column to the list.
SysAider
29
 
Followed the instructions provided above and managed to get the field on the Helpdesk list page but the data is not showing.

But for the User view for their old service list the field is not visible.

This message was edited 7 times. Last update was at Jun. 24, 2008 05:42 AM

SysAid R&D
4
 
Sorry,little mistake.This is the fix;
<?xml version="1.0" encoding="UTF-8"?>
<customColumns>

<customColumn>
<columnAccountID>free</columnAccountID>
<columnTable>sr</columnTable>
<columnAttributeName>assigned_name</columnAttributeName>
<columnCaption>Assigned To Name</columnCaption>
<columnScript><![CDATA[
def prID = rs.getString("responsibility");
def acc=rs.getString("account_id");
def stat = dbConn.prepareStatement("select first_name,last_name from sysaid_user ta where ta.user_name = ? and ta.account_id=? ");
stat.setString(1,prID);
stat.setString(2,acc);
def rss = stat.executeQuery();
def desc = "";
if (rss.next()) {
desc = rss.getString(1);
if (desc!=null)
desc=desc+" "+rss.getString(2);
else
desc=rss.getString(2);
}
rss.close();
stat.close();
return (desc!=null ? desc : "");
]]></columnScript>
</customColumn>
</customColumns>

Please change account name in this xml
SysAider
29
 
Thanks the assigned to name field is showing the names now in the helpdesk list.
SysAider
6
 
hi everybody,

i tried this also. unfortunately it doesn't work -> there is no "Assigned to Name" field in the list....

maybe it's a problem with my understanding:
i thought that customColumns.xml contains definition of all fields i want to add.
the parser said: yupp, go ahead......
but it won't work...... i'm guessing there's a fault i made in the customColumns.xml......
are there any restrictions i'm stick to?
SysAid Wiz
915
 
Avatab...

Type of database seems important.
And I don't think that piece of code work with derby.
SysAider
6
 
oh, you're right.......of course.......i forgot...

it's mysql

btw: does sysaid compute the complete file before it shows the fields in the list?
i thought it would integrate the content of the .xml no matter what's the function of the script.
and if the script cannot be computed you get a failure displayed instead of the field or in the field or what ever.....

SysAider
29
 
I have managed to get the assigned to name field for the helpdesk list.

How do I get the end user submit list (View your old service requests) to show the same?

Which html file am I supposed to edit?

End User Page.bmp

This message was edited 2 times. Last update was at Jul. 08, 2008 04:26 AM

SysAid R&D
4
 
dear Harvinder,
For adding the field to the end user list you just need to pick EndUser list in administrator portal and to change it ,like you did with the previous view.The option to add this field will appear in all SR views from now on.

Dear avatab,
It should work with mysql(and derby too),but this doesn't metter,because I understand from your post the problem is xml (you get parsing error),please send me or attach to your post the xml file and I will be happy to assist you