It's all about the answers!

Ask a question

Subscribers with condition


Fabio Bandelli (122) | asked Nov 05 '13, 8:44 a.m.
 Hello,
I created a list of subscribers, and I would like to insert it based on the value of the "filed against."
I created a javascript but it does not work, what can I do?
please help me! :D

2 answers



permanent link
Ralph Schoon (63.1k33645) | answered Nov 05 '13, 9:35 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Fabio,

JavaScript has no access to complex items like subscribers. This blog post shows how you can create a follow up action to do that kind of tasks after the work item save: https://rsjazz.wordpress.com/2012/11/30/a-create-approval-work-item-save-participant/

The post shows how to add an approval, but subscribers should be very similar.

permanent link
Fabio Bandelli (122) | answered Nov 05 '13, 10:10 a.m.
 Hello Ralph,
then to do what I required I have to do a server-side program? right?
I do not have access to the server in order to plan the program, there is no alternative?

Comments
Ralph Schoon commented Nov 05 '13, 10:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

If you can detect the work items that are relevant e.g. by a query you could run a client that runs every now and then and modifies the work item with the client API e.g. https://rsjazz.wordpress.com/2012/10/29/using-work-item-queris-for-automation/

That is the only alternative to a server extension I see.

If you want to develop a server extension, I would suggest to follow my advice in the blog post how to get started and set up a local development environment that you can use to create and test your extension. You would only have to have someone to deploy the extension on that server.


Fabio Bandelli commented Nov 05 '13, 10:50 a.m.
but if I have created a default value of user list called "SWCC".
I created a condition based on javascript (the script is written, the condition that if "filed in" change field subscriber takes "SWCC" as the default value) and I associated the operation of the operation?

This I followed reading this article https://jazz.net/library/article/1003 


Ralph Schoon commented Nov 05 '13, 11:03 a.m. | edited Nov 05 '13, 11:05 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

We have discussed this over and over here, the JavaScript API is limited. See https://jazz.net/wiki/bin/view/Main/AttributeCustomization#API_for_Javascript and carefully read it. Read Lab 5 at the beginning of https://jazz.net/library/article/1093

If you look, you will not find an Attribute "Subscribers", because subscribers is no attribute but a built in complex collection. JavaScript has no access to it and I don't think you can configure a value provider for it. Similar to approvals, work item links, information on team areas, attachments, roles or information in other work items this is something JavaScript can not access today..


Fabio Bandelli commented Nov 06 '13, 4:12 a.m.

Ok, but the link you sent me the tool as a first response, is already up and running? I insert it into the RTC server and works immediately, of course modifying the attributes? 


Ralph Schoon commented Nov 06 '13, 4:29 a.m. | edited Nov 06 '13, 4:34 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I would suggest to read the information behind the links I sent that you find relevant. Subscribers is not attribute based. The one article adds an approval, not a subscriber, as the name of the link suggests. You could use that to try to develop a subscriber participant.

The API to add a subscriber on the server looks as follows:

private void createSunscriptionFromLoggedInUser(IWorkItem workItem,
        IParticipantInfoCollector collector,IProgressMonitor monitor) throws TeamRepositoryException {
    IContributorHandle currentUser = this.getAuthenticatedContributor();
    workItem.getSubscriptions().add(currentUser);
}


Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.