Jira Service Management Functions
Jira Service Management Functions
- Customer Detail Fields Functions — This section contains functions that enable users to handle Jira Customer Service Management customers detail fields.
- Customer Functions — This section contains functions that enable users to handle Jira Service Management customers.
- addCustomersToServiceDesk — Adds an existing customer or a list of customers to a specified service desk.
- addCustomerToOrganization — Adds an existing customer or a list of customers to a specified organization.
- createCustomer — Creates a Service Desk customer. The newly created customer is not added to any JSD project, however he/she can raise request against unrestricted JSD projects.
- getCustomersObjects — Returns an array of JUser structures
- removeCustomerFromOrganization — Removes a customer or a list of customers from a specified organization.
- removeCustomersFromServiceDesk — Removes a customer or a list of customers from a specified service desk.
- Customer Request Functions — This section contains functions that enable users to handle Jira Service Management customer requests.
- addFeedbackForRequest — Add feedback to the provided requestId_or_Key.
- addJSDComment — Posts a comment on the specified issue.
- addRequestParticipants — Adds request participants.
- answerApproval — Answer to an existing approval.
- createCustomerRequest — Creates a customer request and returns the newly created request as a structure.
- getApproval — Returns an approval structure
- getApprovals — Returns a list of approvals structures
- getAttachmentsForRequest — Returns a list of attachments structures
- getCommentForRequest — Returns a comment structure
- getCommentsForRequest — Returns a list of comments structures
- getCustomerRequest — Returns a customer request structure
- getCustomerRequests — Returns a string array of customer requests keys.
- getCustomerRequestStatus — Returns a list of JSMCustomerRequestStatus structures.
- getFeedbackForRequest — Returns a JSMFeedback structure.
- getRequestParticipants — Returns a string array of request participants keys.
- getSubscriptionStatus — Returns the notification subscription status for the provided user
- isPublicJSDComment — This function returns the type of comment, if the comment is public, the function will return "true"otherwise it will return "false".
- removeFeedbackFromRequest — Removes the feedback from the provided request.
- removeRequestParticipants — Removes request participants.
- Organization Functions — This section contains functions that enable users to handle Jira Service Management organizations.
- addOrganization — Adds an existing organization or a list of organizations to a specified Service Desk project.
- createOrganization — Creates a new customer organization.
- deleteOrganization — Removes a customer organization.
- deleteOrganizationProperty — Deletes the organization property.
- getAllOrganizationIds — Returns the Ids of all Service Desk organizations.
- getOrganizationIdByName — Get the organization id of the provided organization name.
- getOrganizationNameById — Sends an invitation to a customer or a list of customers for a specified Service Desk project.
- getOrganizationPropertyKeys — Gets the organization properties keys.
- getOrganizationPropertyValues — Gets the organization properties keys.
- getUserOrganizations — Gets organizations names in which the user is present.
- getUsersFromOrganizations — Gets users from a specified organization or list of organizations.
- removeOrganization — Removes an organization or a list of organizations from a specified project.
- setOrganizationPropertyValue — Sets the organization property value.
- Request Type Functions — This section contains functions that enable users to handle Jira Service Management request types.
- createRequestTypeInServiceDesk — Creates a new request type in the provided service desk.
- deleteRequestTypeProperty — Removes the property with the provided property key.
- getRequestsTypes — Returns an array of JSMRequestType containing all the Request Type data for the provided parameters.
- getRequestTypeByIdForServiceDesk — Returns a JSMRequestType structure.
- getRequestTypeFields — Returns a string array of custom fields ids.
- getRequestTypeGroupsForServiceDesk — Returns an array of indexed groups.
- getRequestTypePropertyKeys — Returns a list of property keys for the provided parameters.
- getRequestTypePropertyValues — Returns a list of property keys for the provided parameters.
- getRequestTypesForServiceDesk — Returns an array of JSMRequestType.
- getSlaInformation — Gets SLA information for the specified issue.
- removeRequestTypeByIdFromServiceDesk — Removes a request type from the provided service desk.
- setRequestTypePropertyValue — Sets a property value for the provided property key.
- subscribeNotifications — Subscribe to receive notifications.
- unsubscribeNotifications — Unsubscribe to receive notifications.
- Service Desk Functions — This section contains functions that enable users to handle Jira Service Management service desks.
- getAllServiceDeskQueues — Returns an array of JSMQueue structures
- getCustomersFromServiceDesk — Returns a list of customers accounts ids
- getIssuesInQueueRoutine — Returns an array of issue keys.
- getJSDUrl
- getKBArticles — Returns an array of JSMKBArticle for the provided query.
- getServiceDesk — Returns a JSMServiceDesk structure.
- getServiceDeskKBArticles — Returns an array of JSMKBArticle for the provided parameters.
- getServiceDeskQueue — Returns a JSMQueue structure.
Jira Service Management Structures
Below you’ll find the fields of the structures and some examples for each of them to get you an idea of what it is and what it does.
General Example For (some of the) Functions
string customerEmail = "[email protected]";
boolean customerCreated = createCustomer("The Ice Cream Buyer", customerEmail);
if(customerCreated) {
runnerLog("A new customer was invited, let's announce this on the ticket.");
addJSDComment(key, "We invited the customer with the following email '" + customerEmail +"' to join us.", true); //public comment
} else {
addJSDComment(key, "We couldn't invite the customer with the following email '" + customerEmail +"' please take a second look.", false); //internal comment
}
int[] commentsIds = getAllCommentIds(key);
runnerLog("There are '" + size(commentsIds) + "' comments with the following ids: " + commentsIds);
string newOrgName = "iFixit";
createOrganization(newOrgName);
int propsOrgId = getOrganizationIdByName(newOrgName);
runnerLog("We should add the new organization to a JSM project.");
addOrganization({"Org", newOrgName}, "JSM");
runnerLog("Let's add some engineers to the newly created organization");
addCustomerToOrganization({"customer_id", "another_customer_id"}, newOrgName);
runnerLog("Engineers from organization '" + newOrgName + "': " + getUsersFromOrganizations({newOrgName}));
runnerLog("Remove one of them.");
removeCustomerFromOrganization({"customer_id"}, newOrgName);
runnerLog("Now we have the following engineers: " + getUsersFromOrganizations({newOrgName}));
runnerLog("Let's set some properties for a new organization");
setOrganizationPropertyValue(propsOrgId, "DoesItWork", false);
setOrganizationPropertyValue(propsOrgId, "IceCreamType", {"McSUNDAE", "McFlurry"});
runnerLog("What properties do we have set on the organization with id " + propsOrgId + "? ");
string[] properties = getOrganizationPropertyKeys(propsOrgId);
runnerLog("Properties: "+ properties);
for(string prop in properties) {
runnerLog("Property with key '" + prop + "' has value: " + getOrganizationPropertyValues(propsOrgId, prop));
}
runnerLog("Let's put one of the engineers to work.");
setOrganizationPropertyValue(propsOrgId, "DoesItWork", true);
runnerLog("The new value of 'DoesItWork' is: " + getOrganizationPropertyValues(propsOrgId, "DoesItWork"));
runnerLog("Looks like the engineer did a good work.");
runnerLog("Since the ice cream machine is working, let's remove the second property.");
deleteOrganizationProperty(propsOrgId, properties[0]);
runnerLog("Now we only have the following properties: " + getOrganizationPropertyKeys(propsOrgId));
runnerLog("How many organization are associated with project 'JSM': " + size(getAllOrganizationIds("JSM")));
runnerLog("Let's remove the newly created organization from the 'JSM' project.");
removeOrganization({newOrgName}, "JSM");
runnerLog("Now we have only '" + size(getAllOrganizationIds("JSM")) + "' organizatons on the project JSM");
runnerLog("Let's get rid of the new organization since we don't use it anymore.");
//we'll get the organizationsIds before and after the delete of the organization and get the diff to check if the organization was really deleted
int[] initialOrganizations = getAllOrganizationIds();
deleteOrganization(newOrgName);
int[] currentOrganizations = getAllOrganizationIds();
string[] deletedOrgs = arrayDiff(initialOrganizations, currentOrganizations);
if(size(deletedOrgs) == 1 && deletedOrgs[0] == propsOrgId) {
runnerLog("Organization with name: '" + newOrgName + "' does not exist anymore");
}
return "Have a nice day.";
Peacock
, multiple selections available,
Related content
Jira Service Management Functions
Jira Service Management Functions
More like this
Jira Service Management Supported Fields
Jira Service Management Supported Fields
Read with this
Jira Service Management Functions (Power Scripts)
Jira Service Management Functions (Power Scripts)
More like this
Predefined Jira Service Management Structure Types
Predefined Jira Service Management Structure Types
More like this
Predefined Jira Service Management structure types
Predefined Jira Service Management structure types
More like this
Jira Service Desk Routines
Jira Service Desk Routines
More like this
Need support? Create a request with our support team.
Copyright © 2005 - 2025 Appfire | All rights reserved.