Skip to content

Commit 92986b9

Browse files
authored
feat(models): add support for parameters in workflow rule and trigger… (#395)
feat(models): add support for parameters in workflow rule and trigger schemes Added a new `Parameters` field to `WorkflowRuleConfigurationScheme` and refactor to remove `WorkflowTriggerScheme` as it is the same payload
1 parent eabcf49 commit 92986b9

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

.github/workflows/codacy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
4242
- name: Run Codacy Analysis CLI
43-
uses: codacy/codacy-analysis-cli-action@562ee3e92b8e92df8b67e0a5ff8aa8e261919c08 # v4
43+
uses: codacy/codacy-analysis-cli-action@v4.4.5 # v4
4444
with:
4545
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
4646
# You can also omit the token and run the tools that support default configurations

pkg/infra/models/jira_workflow.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,15 @@ type WorkflowTransitionScheme struct {
5252
To *WorkflowStatusAndPortScheme `json:"to,omitempty"` // The status to which this transition goes.
5353
ToStatusReference string `json:"toStatusReference,omitempty"`
5454
TransitionScreen *WorkflowRuleConfigurationScheme `json:"transitionScreen,omitempty"`
55-
Triggers []*WorkflowTriggerScheme `json:"triggers,omitempty"`
55+
Triggers []*WorkflowRuleConfigurationScheme `json:"triggers,omitempty"`
5656
Type string `json:"type,omitempty"` // The type of the transition.
5757
Validators []*WorkflowRuleConfigurationScheme `json:"validators,omitempty"`
5858
}
5959

6060
type WorkflowRuleConfigurationScheme struct {
61-
ID string `json:"id,omitempty"`
62-
RuleKey string `json:"ruleKey,omitempty"`
61+
ID string `json:"id,omitempty"`
62+
RuleKey string `json:"ruleKey"`
63+
Parameters map[string]any `json:"parameters,omitempty"` // Not required for rule config payload
6364
}
6465

6566
type ConditionGroupConfigurationScheme struct {
@@ -79,11 +80,6 @@ type WorkflowTransitionLinkScheme struct {
7980
ToPort int `json:"toPort,omitempty"`
8081
}
8182

82-
type WorkflowTriggerScheme struct {
83-
ID string `json:"id,omitempty"`
84-
RuleKey string `json:"ruleKey,omitempty"`
85-
}
86-
8783
// WorkflowTransitionScreenScheme represents a screen associated with a transition in a workflow in Jira.
8884
type WorkflowTransitionScreenScheme struct {
8985
ID string `json:"id,omitempty"` // The ID of the screen.
@@ -378,7 +374,7 @@ type TransitionUpdateDTOScheme struct {
378374
To *StatusReferenceAndPortScheme `json:"to,omitempty"` // To is the status to which this transition goes.
379375
ToStatusReference string `json:"toStatusReference,omitempty"` // ToStatusReference is the reference of the status to which this transition goes.
380376
TransitionScreen *WorkflowRuleConfigurationScheme `json:"transitionScreen,omitempty"` // TransitionScreen is the screen associated with the transition.
381-
Triggers []*WorkflowTriggerScheme `json:"triggers,omitempty"` // Triggers is a list of triggers associated with the transition.
377+
Triggers []*WorkflowRuleConfigurationScheme `json:"triggers,omitempty"` // Triggers is a list of triggers associated with the transition.
382378
Type string `json:"type,omitempty"` // Type is the type of the transition.
383379
Validators []*WorkflowRuleConfigurationScheme `json:"validators,omitempty"` // Validators is a list of validators associated with the transition.
384380
}

0 commit comments

Comments
 (0)