The JSON.stringify function can be particularly useful when working with issue custom fields, Parses a JSON string into an equivalent value. JSON.parse(String) - the inversion of JSON.stringify.Only values that consist of the following types are supported: JSON.stringify(Any) - converts a value into a JSON string.The following functions are available to convert between different representations of JSON values: Read more about how to interact with properties in theĮntityProperties object documentation. The field returns what can be thought of as a map of all properties, indexed by their keys. To do this, get the properties field of the appropriate object.įor example, app.properties. Issue, project, issue type, comment, user, board, sprint. Using Jira expressions, it is possible to access entity properties of any entity that supports them, that is: Keep in mind that loading data this way is considered an expensive operation,Īnd there is a limit of how many expensive operations a single expression evaluation can have.īecause of this, only load data where it’s not possible to use context variables. Note that null is returned by the constructor if the issue doesn't exist or you don't have permission to view it.Ĭonsult the type reference to learn which types have similar constructors. The method above loads the issue from the database using the given key, then gets the issue’s summary. It will return "undefined" for unavailable variables.įor example, to check if the current project is next-gen, but only if the expression is evaluated in the context of a project, write: To check if a context variable is available, use the typeof operator. For example, to check if the request is not anonymous, write: user != null. These variables are registered in the global scope. customerRequest ( CustomerRequest): The current customer request.serviceDesk ( ServiceDesk): The current service desk.project ( Project): The current project.Requests made by Forge apps must be authenticated with asApp().Īvailable when a JQL query is specified in the request context when using the REST API. Or Forge app that made the request or provided the module.Īlways available for expressions used in app modules and REST API requests made by apps. Equal to null if the request is anonymous. Indexed accessįor example, to get the first issue comment, write:ĭepending on the context in which a Jira expression is evaluated, different context variables may be available: The operator can also be used in combination with computed member access, for example: issue?. issue?.customfield_10010-this expression returns null if the custom field doesn't exist.Or if there is no a.b path in the value of the property. issue.properties?.myProperty?.a?.b-this expression returns null if there is no myProperty defined in the issue,.When accessing the property fails, null is returned. This operator behaves in the same way as regular member access, but with one crucial difference: In expressions where such strict rules are not desired, use the optional chaining operator ?. For example, in the expression a.b where the value of a is null. the left-hand side of the operation is null. ![]() 2 issue.propertiesĪccessing properties in a Jira expression may fail, for example, where:
0 Comments
Leave a Reply. |