lib/redmine_web_server.js
function __fetchTicketInfo(server, ticketid, callback) {

    assert(server.cache_folder);

    var filename = server._ticket_cache_file(ticketid);
    //xx console.log("filename " , filename.red);

    assert(_.isFunction(callback));

    var command = 'issues/' + ticketid.toString() + '.json?include=relations,journals';

    perform_http_get_transaction(server,command, function (err, txt) {

        txt = fixUnicode(txt);

        var ticket = null;
        try {
            var o = JSON.parse(txt);

            fs.writeFileSync(filename, JSON.stringify(o, null, " "));
            console.warn(" writing ", filename);
            ticket= o.issue;
        } catch (err) {
            console.log("error !".red, err.message);
            fs.writeFileSync("toto.txt", txt);
            callback(err);
            return;
            // the ticket may have been deleted
        }
        callback(null,ticket);

    });

}
function __fetchTicketInfo(server, ticketid, callback) {

    assert(server.cache_folder);

    var filename = server._ticket_cache_file(ticketid);
    //xx console.log("filename " , filename.red);

    assert(_.isFunction(callback));

    var command = 'issues/' + ticketid.toString() + '.json?include=relations,journals';

    perform_http_get_transaction(server,command, function (err, txt) {

        txt = fixUnicode(txt);

        var ticket = null;
        try {
            var o = JSON.parse(txt);

            fs.writeFileSync(filename, JSON.stringify(o, null, " "));
            console.warn(" writing ", filename);
            ticket= o.issue;
        } catch (err) {
            console.log("error !".red, err.message);
            fs.writeFileSync("toto.txt", txt);
            callback(err);
            return;
            // the ticket may have been deleted
        }
        callback(null,ticket);

    });

}
function __fetchTicketInfo ( server , ticketid , callback ) { assert ( server . cache_folder ) ; var filename = server . _ticket_cache_file ( ticketid ) ; //xx console.log("filename " , filename.red); assert ( _ . isFunction ( callback ) ) ; var command = 'issues/' + ticketid . toString ( ) + '.json?include=relations,journals' ; perform_http_get_transaction ( server , command , function ( err , txt ) { txt = fixUnicode ( txt ) ; var ticket = null ; try { var o = JSON . parse ( txt ) ; fs . writeFileSync ( filename , JSON . stringify ( o , null , " " ) ) ; console . warn ( " writing " , filename ) ; ticket = o . issue ; } catch ( err ) { console . log ( "error !" . red , err . message ) ; fs . writeFileSync ( "toto.txt" , txt ) ; callback ( err ) ; return ; // the ticket may have been deleted } callback ( null , ticket ) ; } ) ; }
\brief extract the full raw information for a given ticket out of redmine
and store it to a json file in the cache.
any old version of the ticket json file will be overwritten
\ brief extract the full raw information for a given ticket out of redmine and store it to a json file in the cache . any old version of the ticket json file will be overwritten