Jira workflow validator in create transition - expression has complete issue object, lambda function only id/key

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?

Hello @FrankHess,

I think it would make sense to send the entire issue data to the lambda function. I added this to our backlog.

However, I must tell you that right now the workflow validator module is not our priority and I can’t give you any estimate on when (or even if) it will be done. Also note that the module is still in the “beta” stage, which means its API may yet change altogether.

Hi @kkercz ,

thanks for update :+1: - I’ll discuss with my team workarounds.

thanks,
Frank