Skip to end of metadata
Go to start of metadata

Cprime Apps has been rebranded as Anova Apps. Please note the only effect is the company name - all of our products’ names, logos, functionalities, support, etc. is exactly the same. The new location to our documentation space is https://anovaapps.atlassian.net.

Availability

This routine is available starting with katl-commons 1.0.

Syntax

createIssue(projectKey, parentIssueKey, issueType, issueSummary)

or

createIssue(projectKey, parentIssueKey, issueType, summary, priority, description, components, due date, estimate, security_level, custom_fields_mappings)

Starting with version 3.0.2

createIssue(projectKey, parentIssueKey, issueType, summary, priority, description, components, due date, estimate, security_level, field_mappings)  


Cloud Syntax

createIssue(projectKey, parentIssueKey, issueType, summary)

or

createIssue(projectKey, parentIssueKey, issueType, summary, priority, description, components, estimate, security_level, field_mappings)  


Description

Creates an issue based on the provided arguments.

Parameters

Parameter name

Type

Required

Description

projectKey

string

Yes

Key of the project, where the issue will be created, as it is saved in the Administration part.

parentIssueKey

string

Yes

Key of the parent issue. Though the parameter is required, it can take an empty value to specify that the issue is not a sub-task, but a regular issue.

issueType

string

Yes

Type of the issue that will be created.

summary or issueSummary

string

Yes

Summary of the issue that will be created.

priority

string

No

Priority.

description

string

No

Description of the issue that will be created.

components

array of strings

No

Components of the issue that will be created.

due date

date

No

Due date of the issue that will be created.

estimateintervalNo

Original estimate of the issue that will be created.

Parameter is missing in the cloud version.

security level

string

No

Security level of the issue that will be created.

custom fields mappings/

field mappings (since version 3.0.2)

array of strings

No

Mappings of the custom field of the issue that will be created.

Starting with version 3.0.2 the mappings of the custom and system fields of the issue will be created.

Return type

string (the key of the created issue)

Example

Example 1

string issue_priority;//Possible values: "Major", "Critical" etc.
string issue_description;
string[] issue_components;
string issue_security_level;
string[] custom_fields_mapping;

issue_priority = "Critical";
issue_description = "Description of the issue";
issue_components = components; //an array containing all the components of the current project
issue_security_level = "Administrator";
custom_fields_mapping = "STDUP|fmanaila|STDGP|jira-users";
string k = createIssue(
            "PROJECT",
            "PRJ-300",
            "Sub-task",
            "Summary of the sub task" ,
            issue_priority,
            issue_description,
            issue_components,
            currentDate() + "30d",
            "1h 30m",
            issue_security_level,
            custom_fields_mapping
           );
print ("On the project " + project + ", issue " + k + "is created.");

Result: On the project PROJECT, issue PRJ-300 is created. Issue details are as declared above.

 

Example 2

string issue_priority;//Possible values: "Major", "Critical" etc.
string issue_description;
string issue_security_level;

issue_priority = "Critical";
issue_description = "Description of the issue";
issue_security_level = "Administrator";
string k = createIssue(
            "PROJECT",
            "", // passing in empty to create a regular issue rather than subtask
            "Bug",
            "Summary of the sub task" ,
            issue_priority,
            issue_description,
            {}, // no components
            currentDate() + "30d",
            "1h 30m",
            issue_security_level,
            {} // and no custom field mappings
           );
print ("On the project " + project + ", issue " + k + "is created.");

Will create a Bug with no components and no special custom field values (all defaults).

Example 3

string issue_priority;//Possible values: "Major", "Critical" etc.
string issue_description;
string issue_security_level;
string[] assigneeUser;

issue_priority = "Critical";
issue_description = "Description of the issue";
issue_security_level = "10000";
assigneeUser = "assignee|someUserName";
string k = createIssue(
            "PROJECT",
            "", // passing in empty to create a regular issue rather than subtask
            "Improvement",
            "Summary of the sub task" ,
            issue_priority,
            "",
            {}, // no components
            currentDate() + "30d",
            "1h 30m",
            issue_security_level,
			assigneeUser
		);
print ("On the project " + project + ", issue " + k + "is created.");

Will create an Improvement  with no components and the assignee set for user with the username "someUserName".

Example 4  (Cloud only)

string issue_priority;//Possible values: "Major", "Critical" etc.
string issue_description;
string issue_security_level;
string[] assigneeUser;

issue_priority = "Critical";
issue_description = "Description of the issue";
issue_security_level = "10000";
assigneeUser = "assignee|someAccountId";
string k = createIssue(
            "PROJECT",
            "", // passing in empty to create a regular issue rather than subtask
            "Improvement",
            "Summary of the sub task" ,
            issue_priority,
            "",
            {}, // no components
            currentDate() + "30d",
            issue_security_level,
			assigneeUser
		);
print ("On the project " + project + ", issue " + k + "is created.");

Will create an Improvement  with no components and the assignee set for user with the username "someUserName".

See also