Jump to content
Sign in to follow this  
Yogesh.Rajguru24

Notification on log comments

Recommended Posts

I have a requirement where in i need to send notification to assignee of the incident ticket, if the comment is logged by a  user who is not an assignee of that ticket.

i need to achieve this  using macros and not spell action is it possible if yes how?

Assignee is at cr object and log description is at alg object how to validate it 

Share this post


Link to post
Share on other sites

Hi,

this is possible but Site-defined Condition should be built manually:

object zobj;
send_wait(0, top_object(), "call_attr", "alg", "sync_fetch", "MLIST_STATIC", format("type='LOG' AND call_req_id='%s'", persistent_id), -1, 0);
send_wait(0, msg[0], "dob_by_index", "DEFAULT", (int)(msg[1]-1), (int)(msg[1]-1));
zobj = msg[0];
if (assignee != zobj.analyst)
    set_return_data(TRUE);
else
    set_return_data(FALSE);

 

Edited by cdtj

Share this post


Link to post
Share on other sites

Thank you for your reply.

Create site-Defined condition manually means not from UI ?

do we need to create site defined condition by load condition in Sell_Macro table ?

Edited by Yogesh.Rajguru24

Share this post


Link to post
Share on other sites

This is one of the way, but you can simply modify detail form, replace readonly input with textbox one.

Share this post


Link to post
Share on other sites

I tried to create condition but I am getting error message.

I cannot have below mention condition in Macro.

 

send_wait(0, top_object(), "call_attr", "alg", "sync_fetch", "MLIST_STATIC", format("type='LOG' AND call_req_id='%s'", persistent_id), -1, 0); send_wait(0, msg[0], "dob_by_index", "DEFAULT", (int)(msg[1]-1), (int)(msg[1]-1));

 

when I try to load I am getting an error message.

Share this post


Link to post
Share on other sites

My suggestion is to modify detail_macro.htmpl form:

repalce: <PDM_MACRO name=dtlReadonly hdr="Macro Code" attr=usr_string1 colspan=3>

with: <PDM_MACRO name=dtlTextbox hdr="Macro Code" attr=usr_string1 colspan=6 rows=17 size=120 spellchk=no>

And you'll be able to modify macros on the go using web form.

Share this post


Link to post
Share on other sites

I tried to but i got below error.

My macro looks like:-

TABLE Spell_Macro
    del description fragment id last_mod_by last_mod_dt lock_object msg_html
    msg_tmpl_info ob_type persid sym tenant type usr_integer1 usr_integer2 usr_integer3
    usr_string2 usr_string3 usr_string4 
    { "0" ,"Test_1",
    "send_wait(0, top_object(), \"call_attr\", \"alg\", \"sync_fetch\", \"MLIST_STATIC\", format(\"type='LOG' AND call_req_id='%s'\", persistent_id), -1, 0);\\0012send_wait(0, msg[0], \"dob_by_index\", \"DEFAULT\", (int)(msg[1]-1), (int)(msg[1]-1));\\0012zobj = msg[0];\\0012if (assignee != zobj.analyst){\\0012set_return_data(TRUE);\\0012} else {\\0012    set_return_data(FALSE);\\0012}",
    "401468" ,"" ,"" ,"0" ,"" ,"" ,"cr" ,"macro:401468" ,"Test_1" ,"" ,"COND",
    "" ,"" ,"" ,"" ,"" ,"" }

 

Error message:-

 

sql_agent:mdb:dbload-#1648:
07/18 12:25:13.32 sdeuaps155     spelsrvr             6000 ERROR        interp.c               574 __eval__ Code error at line 3 at "if" (syntax error)
07/18 12:25:13.32 sdeuaps155     spelsrvr             6000 ERROR        macro.spl              538 __eval__ Code error at line 3 at "if" (syntax error)
07/18 12:25:13.34 sdeuaps155     spelsrvr             6000 ERROR        ntfr.spl               280 macro::get_notify_rules() error in cond macro execute for att_ntfrlist.1.persistent_id: __eval__ Code error at line 3 at "if" (syntax error)
07/18 12:25:21.68 sdeuaps155     slump_nxd            5504 SIGNIFICANT  server.c              4299 SLUMP: Up Time(5 day 1 hr 7 min 30 sec) Sent (141749583) Received (211986899) Ports in Use (72) Processes (76) Fast Channel (19) 
 

 

Share this post


Link to post
Share on other sites

try to define if statement as:

if ((uuid)assignee.id != (uuid)zobj.analyst.id) {
    set_return_data(TRUE);
} else {
    set_return_data(FALSE);
}

Share this post


Link to post
Share on other sites

We have this same requirement and fulfilled it by adding audit_userid as an activity association on the RIP object then adding a condition on the Log Comment rule that checks if the audit_userid is the same as assignee.  Audit_userid is an out of the box object layer only field that captures the user performing the action.

Not sure if that's what you meant by not using spell action.  We've had no issues with this approach.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...