It's all about the answers!

Ask a question

How to get the Query results using server side Api in validation plugin?


lakshmi jyothsna (3716) | asked May 22 '20, 7:31 a.m.

 Hi All,

Is there any possibility to get the Query results of a personal query in the server side validation plugin ? If so please let me know what is the API to achieve this? 

For better understanding here i am explaining the scenario of this:

We have a custom attribute "EMR NO" in our Task Work Item. Lets say i entered "1" in that . When I am trying to create another "Task" work item it should get automatically pop up with "2" in the "EMR NO" . ie it should auto incremented to the earlier Tasks EMR NO. How can we achieve this ? Kindly help .
Note: we have a personal query in our environment to get the EMR No of the TASKS.

Waiting for your Reply,

Thanks,
Jyothsna.

Accepted answer


permanent link
Ralph Schoon (63.2k33646) | answered May 22 '20, 11:32 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I would suggest to come up with a different approach to create/store and retrieve the unique number.
Running a query for all work items of a type would be the most terrible approach I could think of. Maybe https://github.com/jazz-community/rtc-workitem-numbering contains an idea, not sure.

I am at a loss why this question has anything to do with a validation plugin.
lakshmi jyothsna selected this answer as the correct answer

Comments
lakshmi jyothsna commented May 23 '20, 5:38 a.m. | edited May 25 '20, 2:57 a.m.
Hi Ralph,

Thanks for the reply. Please let me know is there any way to trigger a plugin when work item is loading or creating ? kindly let me know is there any possibility of getting the auto generated value? Thanks again

-Jyothsna


Ralph Schoon commented May 25 '20, 2:59 a.m. | edited May 25 '20, 3:00 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

As the link I already sent you above suggests, you want to write a follow up action for WorkItem save. See https://rsjazz.wordpress.com/2015/09/30/learning-to-fly-getting-started-with-the-rtc-java-apis/ and Especially look at the RTC Extensions Workshop that is referenced.


lakshmi jyothsna commented May 26 '20, 11:41 p.m.
Hi Ralph,

Thanks alot . Its worked for me.

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.