Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to call createIssue() portably between DataCentre and Cloud

FCT_ Malcolm Boekhoff January 4, 2024

The documentation lists the parameters of the Cloud version of "createIssue" as:

projectKey
parentIssueKey
issueType
summary or issueSummary
priority
description
components
due date
security level
summary or issueSummary

Whereas the DataCentre version has an extra parameter "estimate":

projectKey
parentIssueKey
issueType
summary or issueSummary
priority
description
components
due date
estimate <--- THIS PARAMTERS IS MISSING FROM THE CLOUD VERSION
security level
custom fields mappings/field mappings

I do not require an "estimate" parameter in either version, but it needs to be passed in the DataCentre version, since I need to pass the "custom fields mappings".

How can I call "createIssue" in such a way that I do not have to change the call between the Cloud and DataCentre versions?

I was thinking I could use a "map" for the parameters, but since "custom fields mappings/field mappings" does not look like a proper parameter name, what would the keys to the map be?

1 answer

0 votes
FCT_ Malcolm Boekhoff January 7, 2024

Anyone??

There doesn't seem to be much interest in answering this so I will have to do a try..catch block and see if that works (i.e. try will fail with 'estimate' parameter in Jira Cloud so re-issue the createIssue call without the 'estimate' parameter in the catch section).

Ye... that didn't work:

20240108.Jira.Cloud.CreateIssue.No.Estimate.Parameter.jpg

 BOTTOM LINE

You cannot compile DataCentre SIL using createIssue (and passing 'estimate' parameter) on Jira Cloud.

Similarly,

You cannot compile Cloud SIL using createIssue (and passing 'estimate' parameter) on Jira DataCentre

That's a colossal mistake by the SIL developers, because now we all have to have 2 versions of our SIL scripts.

It's a shame SIL does not support the JS 'spread' operator, at least then we could check some environment variable and remove the 'estimate' parameter in the Cloud version and only have one SIL codebase.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events