Re: Feature Request : Copy Issue id and title separated by '; ' to the clipboard

Tom Ekberg <[email protected]> Wed, 8 Nov 2023 16:09:12 +0000
Newsgroups gmane.comp.bug-tracking.roundup.user
Message-ID <CO3PR08MB79576A9D751D41FDD014746FCAA8A@CO3PR08MB7957.namprd08.prod.outlook.com>
Norbert,

I put this in the first <td> element of the comment field.

Time tracking example: <button type="button" onclick="set_comment()"><span>:spend 1.5h 2023-11-01</span></button><br>

This JS function does the work.


/* Insert a :spend string for yesterday into the comment field. */

function set_comment() {

    var ele = document.getElementById('comment_text');

    var now = new Date();

    var then = new Date(now.getTime() - 24*60*60*1000);

    var month = then.getMonth() + 1; // Month is 0 based.

    var date= then.getDate();

    var s;

    if (month < 10) {

        month = '0' + month;

    }

    if (date < 10) {

        date = '0' + date;

    }

    s = ':spend 1.5h ' + then.getFullYear() + '-' + month + '-' + date;

    ele.value = ele.value + '\n' + s;

}

Not quite what you want. You could pass the issue id and title to the function to compute the "issue,title" string. Google "javascript writing to clipboard" to find various ways to write to the clipboard with JS.


Tom Ekberg
Senior Computer Specialist
Department of Laboratory Medicine and Pathology
4th Floor, Pat Steel Building, currently WFH
Home: (253) 561-2509
Email: [email protected]<mailto:[email protected]>

From: SCHLEMMER Norbert <[email protected]>
Sent: Wednesday, November 8, 2023 12:51 AM
To: [email protected]
Subject: [Roundup-users] Feature Request : Copy Issue id and title separated by '; ' to the clipboard


Hello all



How can we add a button to the "Editing issue" template to copy the issue id and the title separated by '; ' to the clipboard.



I need this very often to add references to other issues.



[cid:[email protected]]



Thanks

Norbert

_______________________________________________
Roundup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/roundup-users
image001.png (image/png, 6.1 KB) - not displayed