Forum OpenACS Q&A: configing new-ticket with something like domain-edit.tcl

In Classic ACS you can config notification to members when changes or
additions occur on a ticket.  Such as the follwing.

Notify Admin on create?  Yes  No
Notify on comment add?  Yes  No
Notify on status change?  Yes  No

I haven't been able to find this in OpenACS.  Con someone point me in
the right direction?

While the new system is not perfect yet, new-ticket has its own notification system that is more user-centric. This means that when you see an issue, you can easily request to be notified of all changes to that issue. You can even batch up your notifications hourly, daily, or weekly.

There are improvements to be made, like notifications of all new issues, and defaulting to notifications ON when you enter an issue. Try it out and see how it works for you.

I thought that was the case.  i.e. "I'm interested" "I am no longer interested" allow a user to "request" email on a ticket.  Unfortunately, I can't seem to get new-ticket to send any email.  Nothing on issuing a new ticket or updating or adding a comment.  I happily get email notifications when; adding a user, adding a user to a project, getting a forgotten email/password, and getting error message report ("Errors on the xxx network").

Can anyone give me an idea as to how i would trouble shoot this?  I am getting error report each time i add an issue.  the server log shows the same error but with more detail...

Notice: page /new-ticket/issue-new-2.tcl has a ticket_admin_url_stub call

[01/Sep/2000:00:03:51][3362.48132][-conn13-] Error: Ns_PgExec: result status: 7 message: ERROR:  parser: parse error at or near "("

[01/Sep/2000:00:03:51][3362.48132][-conn13-] Notice: failed trying to look up previous posting: Database operation "1row" failed (e)
[01/Sep/2000:00:03:51][3362.48132][-conn13-] Notice: page /new-ticket/issue-new-2.tcl has a ticket_admin_url_stub call

thx
david

It looks like it's choking on an unported query:

if [catch { set n_previous [database_to_tcl_string $db "select count(*) from ticket_issues
where one_line = '$QQone_line'
and project_id = $project_id
and dbms_lob.instr(message,'[bboard_convert_plaintext_to_html $QQmessage]') > 0"]} errmsg] {
    ns_log Notice "failed trying to look up previous posting: $errmsg"
} else {
    # lookup succeeded
    if { $n_previous > 0 } {
	incr exception_count
	append exception_text "
  • There are already $n_previous messages in the database with the same subject line and body. Perhaps you already posted this? Here are the messages:
      " set selection [ns_db select $db "select first_names || ' ' || last_name as name, email, posting_time from ticket_issues, users where one_line = '$QQone_line' and project_id = $project_id and dbms_lob.instr(message,'[DoubleApos $message]') > 0 and ticket_issues.user_id = users.user_id"]

  • The dbms_lob.instr function is an oracle only construct. Go ahead and enter this in the /sdm at openacs.org.
    So, given the existance of an oracle package call in the issue-new-2.tcl file, can I assume that no one who has used the new-ticket module has been able to get email notifications to work?

    I am not a tcl expert but I see that this call is made after an "if" statment is satisified, so maybe other users are not satifying this if clause and thus are not running into this error.  And since the email notifications code happens later in the script this invalid call to dbms_lob.instr breaks the script so the email is never sent.  But yet the new issue is being added to the database.

    Any sage advice gladly received.

    david

    David. The answer is that this needs documentation. The error you're seeing is being caught by a catch statement, so no that's not your problem. Try going to /notifications and making sure that you're set up to receive email. Then check your error log for errors while talking to your mail server (notifications are all asynchronous now in new-ticket).
    Have been digging a little more.  the bottome of issue-new-2.tcl has the code to send email after new ticket creation.  here is the code...

    #send out the email

    set ticket_email [ticket_reply_email_addr]
    set extra_headers [ns_set create]
    ns_set update $extra_headers "Reply-to" $ticket_email

    if { $notify_p == "t" } {

        set selection [ns_db select $db "select
    email as notify_email
    from users, ticket_assignments
    where project_id = $project_id
    and users.user_id = ticket_assignments.user_id
    "]

        while { [ns_db getrow $db $selection] } {
            set_variables_after_query
            ns_sendmail $notify_email $email "New issue $one_line in project $project_title (TR#$new_id)" "Priority: $priority
    Submitted By: $name
    Description: $message

    Please use $url/issue-view.tcl?msg_id=$new_id to manage this issue." $extra_headers
            ns_write "<br> Emailed $notify_email"


      So the "set selection" builds a select statement on two tables and the one table "ticket_assignments" in my database is empty, so this statement returns 0 rows.

    Next, the while statement loops through the "rows" returned from the above metioned select statement and invokes ns_sendmail.  Since my "ticket_assignments" table has no rows, the select statement has no rows for the while statement to work on hence no emails to my team members.

    My ticket_projects has default_assignee assigned for the project so shouldn't the "ticket_assignments"  table have some entries?

    Again, sage advice most welcome.

    P.S. I getting the feeling this is a configuration issue.

    thanks again

    david

    After adding an entry into ticket_assignments manually, and modifying the ns_sendmail line in the while loop from this ....

    #ns_sendmail $notify_email $email "New issue $one_line in project $project_title (TR#$new_id)" "Priority: $priority

    to this ...

    ns_sendmail $notify_email $email "New issue $one_line in project $project_title (TR#$new_id)" "Priority: $severity

    to account for the $priority not existing as a vaild variable I was finally able to get an email sent for a new issue created.

    So now I am trying to figure out how the system sends emails for changes to existing issues. i.e. adding a comment, or updating other info.  Because it doesn't seem to work for me right now.  Again, probably a config issue.  I checked /notifications and everyone is set up for "instant" notification.  I know that email notification is automated ( and "asynchronous" in Ben's words) somehow.  But how ...

    > So now I am trying to figure out how the system sends emails for changes to existing issues. i.e. adding a comment, or updating other info. Because it doesn't seem to work for me right now. Again, probably a config issue. I checked /notifications and everyone is set up for "instant" notification. I know that email notification is automated ( and "asynchronous" in Ben's words) somehow. But how ...
    In my OpenACS 3.2.5 New-Ticket installation, notifications were not working by default. The problem was that users defaulted to "instant" notification and there was no mechanism in place to make instant notification occur. (There are, on the other hand, commands in tcl/notification-defs.tcl to make hourly, daily, or weekly notifications occur.) You can fix this by adding a line such as the following to notification-defs.tcl (e.g. just after the last ns_schedule_daily line):
         ad_schedule_proc 500 user_send_notifications instant
    
    The "500" means wait 500 seconds before checking and sending any outstanding "instant" notifications -- set whatever interval you prefer. Restart aolserver to pick up the change.