Re: nosylist/assignedto per subject

Tom Ekberg <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.user
Message-ID <[email protected]>
Anthony,

I have to agree that making the assignedto field into a multilink is not recommended. I needed to do that with two of our trackers. I ended up creating a new field, assignedto_multi. The activities were:

   * Change all of the code references to assignedto to properly reference assignedto_multi.
   * Copy the assignedto values for all issues to assignedto_multi.
   * Modify user-defined queries that refer to assignedto.

I had previously written an API for roundup_admin that helped with this. The assignedto -> assignedto_mutli part is:

import tracker_admin
tracker = 'it'

def main():
     admin = tracker_admin.Admin('/var/www/html/' + tracker)
     for (id,assignedto) in admin.find_props('issue', ['id', 'assignedto'], order='id'):
         if assignedto:
             admin.set('issue', id, assignedto_multi=assignedto)
     admin.close()

if __name__ == '__main__':
     main()

A side effect was that the activity field changed. One user complained about that. The find_props method has no corresponding roundup-admin command. It's like 'list' with more than one property. The code to change user-defined queries was similar.

So, it is not recommended, but is possible. If anyone wants the tracker_admin code, just ask.

Tom Ekberg
Senior Computer Specialist, Lab Medicine
University of Washington Medical Center
1959 NE Pacific St, MS 357110
Seattle WA 98195
work: (206) 598-8544
email: [email protected]

On Thu, 18 Jun 2015, Anthony Pankov wrote:

> Date: Thu, 18 Jun 2015 12:22:00 +0300
> From: Anthony Pankov <[email protected]>
> To: Martin Thomas Swaton <[email protected]>
> Cc: Roundup Users <[email protected]>
> Subject: Re: [Roundup-users] nosylist/assignedto per subject
> 
> Hello, Martin.
>
>> Can more than one user be assigned to an issue, or is this just a single
>> value field?
> It depends on your schema.
>
> Default is:
> issue = IssueClass(db, "issue",
>    --->     assignedto=Link("user"), <----
>                keyword=Multilink("keyword"),
>                priority=Link("priority"),
>                status=Link("status"))
>
> This  mean  single  value  field. If you want multiple values you need
> Multilink("user").  I  don't  suggest  you to  replace  'assignedto'  type
> because default template/extension/detectors expect it singlevalued.
>
> You may add to the issue scheme field such as
>                members=Multilink("user"),
> and than treat it by your own.
>
>
>
>> Thank you Anthony,
>> awesome, I will try that and extend it to our needs.
>> And if I want to assign someone would I just do something like:
>>         newvalues['assignedto'] = 'user1'
>> Can more than one user be assigned to an issue, or is this just a single
>> value field?
>> Thanks for your quick help!
>> Am 17.06.2015 17:27, schrieb Anthony Pankov:
>> I   think  you  can modify detectors/nosyreactions.py (or rename it to
>> mynosy.py).
>> Modification  can  be  made just in  'updatenosy' function or in your
>> own  function.  If  you  create your own auditor function 'mynosy' you
>> have to replace strings in 'init':
>> from
>>       db.issue.audit('create', updatenosy)
>> to
>>       db.issue.audit('create', updatenosy, priority=10)
>>       db.issue.audit('create', mynosy, priority=20)
>> Your function
>> def mynosy(db, cl, nodeid, newvalues):
>>    # in case of creation title properties (subject) is in newvalues dict
>>     if newvalues['title'] == 'important thing' :
>>          nosy = newvalues.get('nosy', [])
>>          ...
>>          nosy.append('user2')
>>          ..
>>          newvalues['nosy'] = nosy
>> P.S. Code and solution above is unproven.
>> Hi roundup'lers,
>> I am quite new to roundup and need your help.
>> I would like to inform specific users or groups of users about new
>> issues based on the subject of the issue.
>> I guess this should be possible via a detector or/and a reactor.
>> But I am not familiar with writing such a script and have no idea
>> how to make sure, that this script is executed priour to the nosy
>> notification.
>> as an example:
>> a new mail issue is submitted with the subject "mail issue"
>> I want to notify "user a, user b and user c"  about issues that are =~
>> /mail/i
>> and want to assign "user a" to an issue that =~ /important mail/i
>> Can anybody show me how to realice this?
>>   From my understanding of the detectors (compared to the nosy
>> detector) this should only be a few lines to
>> * define the nosy group for each tag in a dict1
>> * define assignees per tag dict2
>> * create nosy members from the defined dict1
>> * create assignedto users from the other dict2
>> and everything else should be done from the normal nosy detector
>> if this is called after this one.
>> hope this is possible and someone can help me.
>> best regards,
>> Martin
>
>
>
>
> -- 
> Best regards,
> Anthony                          mailto:[email protected]
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Roundup-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/roundup-users
>


------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.