It's all about the answers!

Ask a question

Create work item programatically based on selection checkbox enumeration type.


Abuzaid Shaikh (89145) | asked Feb 10 '13, 9:21 a.m.
 Hi,

I have enumeration of type checkbox,  i want to create work item programmatically of all the value that are selected in the checkbox. Is there any way to do this?

Accepted answer


permanent link
Michele Pegoraro (1.8k12114101) | answered Feb 11 '13, 9:23 a.m.
I've done things like this. As Ralph says you could do it with a participant (if the user that save the work-item can create other work items) or with event handlers if you want to use another user (like technical user) with the runAs method.
Ralph Schoon selected this answer as the correct answer

Comments
Abuzaid Shaikh commented Feb 13 '13, 2:24 a.m.

 Hi Michele,


Thanks for your reply.

I am new to plugin creation and coding in RTC.
The work item will be created by the same user that saved the work item.
Can you please help me ?


Ralph Schoon commented Feb 13 '13, 2:47 a.m. | edited Feb 13 '13, 2:57 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Run https://jazz.net/library/article/1000 to understand how to create and develop a participant. See http://rsjazz.wordpress.com (e.g. for information about enumerations) and search this forum for more API hints. Please note, extending RTC this way requires Java and development skills. Please also note, if you use a string to store the enumeration literals, you have to built in knowledge about the enumeration you use into the participant.


Michele Pegoraro commented Feb 13 '13, 2:50 a.m.

If you are new the best thing is to start with the article Ralph has posted.

In order to do this you have to create a precondition on the work item save operation. In this precondition you have to read your custom enumeration literal values and then use the IWorkItemServer.saveWorkItem2 method to save a new work item.
It's not so simple if you're not used with RTC extension so I suggest you to follow the article. It will show you how to create and deploy a precondition. Then, using the SDK and searching here in the forum you can find how to perform each single step.

One other answer



permanent link
Ralph Schoon (58.0k23642) | answered Feb 11 '13, 5:25 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
This should be possible by creating a participant. It could e.g. on save or a state change create work items. See https://jazz.net/library/article/1000 for how to create and develop a participant. I try to provide hints about the API on http://rsjazz.wordpress.com although I have not written a server operational behavior to create work items, there are other hints that might be interesting.

Your answer


Register or to post your answer.