|
81 | 81 | import org.kohsuke.stapler.DataBoundSetter;
|
82 | 82 | import org.kohsuke.stapler.QueryParameter;
|
83 | 83 | import org.kohsuke.stapler.Stapler;
|
84 |
| -import org.kohsuke.stapler.StaplerRequest; |
| 84 | +import org.kohsuke.stapler.StaplerRequest2; |
85 | 85 | import org.kohsuke.stapler.bind.JavaScriptMethod;
|
86 | 86 | import org.kohsuke.stapler.interceptor.RequirePOST;
|
87 | 87 |
|
@@ -157,7 +157,7 @@ public List<String> getAttachments(String className, String name) {
|
157 | 157 | * @return
|
158 | 158 | */
|
159 | 159 | private @CheckForNull AbstractProject getJobName() {
|
160 |
| - StaplerRequest currentRequest = Stapler.getCurrentRequest(); |
| 160 | + StaplerRequest2 currentRequest = Stapler.getCurrentRequest2(); |
161 | 161 | return currentRequest != null ? currentRequest.findAncestorObject(AbstractProject.class) : null;
|
162 | 162 | }
|
163 | 163 |
|
@@ -229,9 +229,9 @@ public JiraTestDataPublisher(
|
229 | 229 | .withConfigs(Util.fixNull(configs))
|
230 | 230 | .build();
|
231 | 231 |
|
232 |
| - if (Stapler.getCurrentRequest() != null) { |
| 232 | + if (Stapler.getCurrentRequest2() != null) { |
233 | 233 | // classic job - e.g. Freestyle project, Matrix project, etc.
|
234 |
| - AbstractProject project = Stapler.getCurrentRequest().findAncestorObject(AbstractProject.class); |
| 234 | + AbstractProject project = Stapler.getCurrentRequest2().findAncestorObject(AbstractProject.class); |
235 | 235 | TestToIssueMapping.getInstance().register(project);
|
236 | 236 | JobConfigMapping.getInstance().saveConfig(project, getJobConfig());
|
237 | 237 | } else {
|
@@ -585,7 +585,7 @@ public String getDisplayName() {
|
585 | 585 | * @throws FormException
|
586 | 586 | */
|
587 | 587 | @Override
|
588 |
| - public boolean configure(StaplerRequest req, JSONObject json) throws FormException { |
| 588 | + public boolean configure(StaplerRequest2 req, JSONObject json) throws FormException { |
589 | 589 |
|
590 | 590 | try {
|
591 | 591 | jiraUri = new URI(json.getString("jiraUrl"));
|
@@ -660,7 +660,7 @@ private void tryCreatingStatusToCategoryMap() {
|
660 | 660 | * @throws FormException
|
661 | 661 | */
|
662 | 662 | @Override
|
663 |
| - public TestDataPublisher newInstance(StaplerRequest req, JSONObject json) throws FormException { |
| 663 | + public TestDataPublisher newInstance(StaplerRequest2 req, JSONObject json) throws FormException { |
664 | 664 | String projectKey = json.getString("projectKey");
|
665 | 665 | String issueType = json.getString("issueType");
|
666 | 666 | metadataCache.removeCacheEntry(projectKey, issueType);
|
@@ -787,7 +787,7 @@ public ListBoxModel doFillIssueTypeItems(@QueryParameter String projectKey) {
|
787 | 787 | @JavaScriptMethod
|
788 | 788 | public FormValidation validateFieldConfigs(String jsonForm) throws FormException {
|
789 | 789 | // extracting the configurations for associated with this plugin (we receive the entire form)
|
790 |
| - StaplerRequest req = Stapler.getCurrentRequest(); |
| 790 | + StaplerRequest2 req = Stapler.getCurrentRequest2(); |
791 | 791 | JSONObject jsonObject = JSONObject.fromObject(jsonForm);
|
792 | 792 | JSONObject publishers = jsonObject.getJSONObject("publisher");
|
793 | 793 | JSONObject jiraPublisherJSON = null;
|
|
0 commit comments