I’m implementing a forge workflow validator to ensure issue summary is following some criteria like no issue with same summary exists in project. Validator can be easily implemented
- perform rest call using issue id
const res = await api
.asApp()
.requestJira(route`/rest/api/3/issue/${issue.key}?fields=issuetype,summary,project,customfield_10063&expand=fields,renderedFields`);
...
const response = await api.asApp().requestJira(route `/rest/api/3/project/${pkey}/version`, {
headers: {
'Accept': 'application/json'
}
});
...
- validate result based on some rules including the fetched versions
However this doesn’t work in the create transition as the issue isn’t created yet ;-). Checking variables in lambda function only the documented variables are available (https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-workflow-validator--beta-)
INFO 19:31:25.325 XXX { id: 10105, key: 'DEMO-100' }
INFO 19:31:25.327 XXX { id: '1' }
INFO 19:31:25.327 XXX { id: '10014' }
Using expression approach the complete issue is available … but I can’t perform xhr calls to get e.g. all project versions for applying validation rules.
Any suggestions/workarounds?