How to trigger a script on SAVE button?
Accepted answer
The answer remains, the required attributes is controlled by a mechanism that is built in the tool based on the pre-condition/adviser extension point for the work item save operation.
You would have to create your own required attributes condition that does all this.
Because it has to work with the UI - all the required attributes are marked with a red asterisk - the built in advisor has some tight integrations that are not available to you and can not be extended. I have very recently looked at the code.
So you would try to create your own advisor and then you would run into the problem that your advisor has no integration into the UI and can't show the red asterisk. This makes it even worse.
You would have to try to rely on the trick that is used in the code to get the attribute configuration from the configuration of the built in advisors and run your advisor beforehand - put it at the beginning of the list in your process configuration.
You would still rely on the way advisors return the error and it gets displayed.
I would suggest to create an enhancement request instead to show all the required attributes in the hover.
You would have to create your own required attributes condition that does all this.
Because it has to work with the UI - all the required attributes are marked with a red asterisk - the built in advisor has some tight integrations that are not available to you and can not be extended. I have very recently looked at the code.
So you would try to create your own advisor and then you would run into the problem that your advisor has no integration into the UI and can't show the red asterisk. This makes it even worse.
You would have to try to rely on the trick that is used in the code to get the attribute configuration from the configuration of the built in advisors and run your advisor beforehand - put it at the beginning of the list in your process configuration.
You would still rely on the way advisors return the error and it gets displayed.
I would suggest to create an enhancement request instead to show all the required attributes in the hover.
One other answer
I am unsure about what you want to do, since you don't provide any specifics.
The only way to do something after the save of a work item is a follow up action. You can run a script from there.
The only way to do something after the save of a work item is a follow up action. You can run a script from there.
Comments
I should have given more specifics. Here is what I want to do:
I have 25 mandatory fields in a workitem, spread across different tabs. Now if a field is mandatory and not filled by a user, RTC gives message about it (on click of SAVE button). What I am trying to script is, on click of SAVE, a notification will be displayed, which will list out all such fields which are mandatory but are not filled. This will be more convenient to users rather then filling up a field, then clicking save, one by one...
so will a follow-up action help to trigger a script on click of SAVE button of the work item?
Please let me know.
1 vote