Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JENKINS-49178 Support JIRA Cloud comment event.
- Loading branch information
Showing
9 changed files
with
235 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 54 additions & 69 deletions
123
...nTest/resources/com/ceilfors/jenkins/plugins/jiratrigger/integration/cloudAddComment.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...ain/groovy/com/ceilfors/jenkins/plugins/jiratrigger/webhook/WebhookJsonParserUtils.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.ceilfors.jenkins.plugins.jiratrigger.webhook | ||
|
||
import org.codehaus.jettison.json.JSONObject | ||
|
||
/** | ||
* @author ceilfors | ||
*/ | ||
class WebhookJsonParserUtils { | ||
|
||
/** | ||
* Fills details needed by JRC JSON Parser that are missing in Webhook events. | ||
*/ | ||
static void satisfyRequiredKeys(JSONObject json) { | ||
JSONObject issue = json.getJSONObject('issue') | ||
putIfAbsent(issue, 'expand', '') | ||
} | ||
|
||
static void putIfAbsent(JSONObject jsonObject, String key, Object value) { | ||
if (!jsonObject.opt(key)) { | ||
jsonObject.put(key, value) | ||
} | ||
} | ||
} |
Oops, something went wrong.