[All Adaptavist Apps]

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note that these are only accessible on the object returned by getFieldById.

MethodDescriptionExample
getValue

Returns the value of a field

Return type depends on the field you’re updating:

  • Summary: string

  • Description: string or Atlassian Doc Format depending on your Jira configuration

  • Labels: string[]

  • Priority: { name: string, id: string }

  • Assignee: { accountId: string, displayName: string }

Code Block
languagejs
getFieldById("summary").getValue()

getName

Returns the name of a field

Return type: String

Code Block
languagejs
getFieldById("summary").getName()

getDescription

Returns the description of the field

Return type: String

Code Block
languagejs
getFieldById("summary").getDescription()

isVisible

Returns whether the field has been hidden

Return type: boolean

Code Block
languagejs
getFieldById("summary").isVisible()

getId

Returns the id of the field

Return type: string

Code Block
languagejs
getFieldById("summary").getId()

Available Write Methods

Note these are only accessible on the object returned by getFieldById and getChange.

Info
If you are setting a field value which is in Atlassian Doc Format, Atlassian provides a tool that allows you to generate the ADF. You can read more in Atlassian's documentation.
MethodDescriptionExample

setName(name)

Updates the field name

Parameter: name

Parameter type: string

Code Block
languagejs
getFieldById("summary").setName("A new name")

setDescription(desc)

Updates the field description

Parameter: desc

Parameter type: string


Code Block
languagejs
getFieldById("summary").setDescription("A new description")



setVisible(visible)

Updates the fields visibility

Parameter: visibile

Parameter type: boolean

Code Block
languagejs
getFieldById("summary").setVisible(false)

setValue(value)

Updates the field value

Parameter: value

Parameter type: Depends on the field you’re updating

  • Summary: string

  • Description: string or Atlassian Doc Format depending on your Jira configuration

  • Labels: string[]

  • Priority: { name: string, id: string }

  • Assignee: { accountId: string, displayName: string }

Code Block
languagejs
getFieldById("summary").setValue(<FieldValue>)
setReadOnly(readable)

Sets a field to read-only

Parameter: readable

Parameter type: boolean

Code Block
languagejs
getFieldById("summary").setReadOnly(true)

Make REST Requests

You can use makeRequest to hit the Jira Cloud REST API.

...