LogoLogo
  • ๐Ÿ“‘Introduction
  • ๐Ÿ› ๏ธCookbooks
    • โฑ๏ธExport Issue History
    • ๐Ÿ‘พCreate Jira Issue
    • ๐ŸงฉExtract customfields from issue(s)
    • ๐ŸŒ„Upload Content Attachment
    • ๐ŸšฎCreate Jira ITSM Request
    • ๐ŸšœEdit Jira Issue (Explicit)
    • ๐Ÿš›Edit Jira Issue (Implicit)
    • ๐ŸšŽCreate Jira Workflow
    • ๐Ÿ—ƒ๏ธAdd CustomField to Screen
    • ๐ŸšŸSearch Project Boards
    • ๐Ÿ“…Get User Last-Login Info
    • ๐Ÿค’Remove User Access
    • ๐ŸคฏSuspend User Access
    • ๐ŸฅณRestore User Access
    • ๐Ÿš‹Extract Project Administrators
    • ๐ŸงบSearch Jira User By Email
    • ๐ŸšžSearch Contents By CQL
    • ๐ŸŒŠCascade Permissions from Parent to Child
    • ๐ŸŽญPage Permission Helper
    • ๐Ÿค–Atlassian SCIM Onboarding
    • ๐Ÿ˜ƒCreate User via SCIM
    • ๐Ÿ›ฐ๏ธIssue Permission Helper
  • Jira Software Cloud
    • ๐Ÿ—ƒ๏ธIntroduction
    • ๐Ÿ“ฎAnnouncement Banner
    • ๐Ÿ”Application Roles
    • ๐Ÿ›ก๏ธ Audit records
    • ๐Ÿ“ˆDashboards
    • ๐Ÿ—„๏ธFilters
      • ๐ŸคSharing
    • ๐Ÿ‘ซGroups
    • ๐ŸžIssues
      • ๐Ÿ“ŽAttachments
      • ๐Ÿ“ฌComments
      • ๐ŸƒFields
        • ๐Ÿ–ผ๏ธConfiguration
          • ๐ŸคItems
          • ๐Ÿ”ƒSchemes
        • ๐ŸณContext
          • ๐Ÿ•งOption
        • ๐Ÿ—‘๏ธTrash
      • ๐Ÿท๏ธ Labels
      • ๐Ÿ”—Link
        • ๐Ÿ”ƒRemote
        • ๐Ÿ–‡๏ธTypes
      • ๐Ÿš›Metadata
      • ๐ŸฃPriorities
      • ๐Ÿ€Resolutions
      • ๐Ÿ“ŒSearch
      • ๐Ÿ“ฆType
        • ๐ŸŽดScheme
        • ๐Ÿ›…Screen Scheme
      • ๐Ÿ“ Vote
      • ๐ŸŽฏWatcher
      • ๐Ÿ•ฐ๏ธWorklogs
      • ๐Ÿ“คProperties
      • ๐Ÿ“ญArchiving
    • ๐Ÿ”“Permissions
      • ๐Ÿ“œScheme
        • ๐Ÿ”‘Grant
    • ๐Ÿ“šProjects
      • ๐ŸงฉCategories
      • ๐Ÿ”ฎComponents
      • ๐ŸšงPermission Schemes
      • ๐Ÿ“ฌNotification Schemes
      • ๐Ÿ’ผRoles
        • ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘งActors
      • ๐ŸงตTypes
      • ๐ŸงฑVersions
      • ๐Ÿช”Validation
      • ๐Ÿ™ŒFeatures
      • ๐Ÿ“คProperties
    • ๐Ÿ““Screens
      • ๐Ÿ“‚Tabs
        • ๐ŸงฐFields
      • ๐Ÿ“ Schemes
    • โš™๏ธServer
    • ๐Ÿ”ฉJQL
    • โš—๏ธTasks
    • ๐Ÿค“Users
      • ๐Ÿ“ Search
    • ๐Ÿ–จ๏ธWorkflow
      • ๐Ÿš›Scheme
        • ๐Ÿ“ฏIssue Type
      • ๐Ÿ—บ๏ธStatus
    • โš–๏ธMyself
    • ๐Ÿ“Teams
  • Jira Agile
    • ๐Ÿœ๏ธIntroduction
    • ๐Ÿ“‰Boards
      • ๐Ÿ“ƒBacklog
    • ๐Ÿ—“๏ธSprints
    • ๐Ÿ“ˆEpics
  • Jira Service Management
    • ๐Ÿ—บ๏ธIntroduction
    • ๐Ÿ‘จโ€โš–๏ธCustomer
    • โ„น๏ธInfo
    • ๐Ÿ“šKnowledgebase
    • ๐Ÿ›‚Organization
    • ๐Ÿ“™Request
      • ๐ŸšซApproval
      • ๐Ÿ“‚Attachments
      • ๐Ÿ“ฌComments
      • ๐Ÿ“ฎFeedback
      • ๐Ÿ‘ฅParticipants
      • โฐSLA
      • ๐Ÿ’พTypes
      • โš™๏ธService Desk
        • ๐Ÿ›Ž๏ธQueue
    • ๐Ÿ“™Workspaces
  • Jira Assets
    • ๐Ÿ“ Introduction
    • ๐Ÿ‘พIcons
    • ๐Ÿ”ŽAql
    • ๐Ÿ›๏ธObject
      • ๐Ÿ“ Schema
      • ๐ŸงฐType
        • ๐Ÿ›Ž๏ธAttribute
  • Confluence Cloud
    • ๐ŸŽ‘Introduction
    • ๐Ÿ“‰Analytics
    • ๐Ÿ“ขContent
      • ๐ŸŽฎProperties
      • ๐Ÿ“‚Attachments
      • ๐Ÿ“ฌComments
      • ๐ŸšฉLabels
      • ๐ŸŽŽChildren/Descendants
      • ๐Ÿ›ก๏ธPermissions
      • ๐Ÿ”žRestrictions
        • ๐ŸŽ‘Operations
          • ๐Ÿซ‚Group
          • ๐Ÿ‘คUser
      • ๐Ÿ”ƒVersions
    • ๐Ÿ’พSpace
      • ๐Ÿ›ก๏ธPermissions
    • ๐Ÿ”ฐLabel
    • ๐Ÿ”ŽSearch
    • ๐Ÿ–ผ๏ธLong Task
    • ๐Ÿ—ƒ๏ธTemplate
    • ๐ŸŒŠV2
      • ๐Ÿ”๏ธIntroduction
      • ๐ŸงบAttachments
        • ๐Ÿ’ปVersions
      • ๐Ÿ“ƒPage
      • ๐ŸชŸSpace
      • ๐Ÿ—ƒ๏ธCustom Content
  • Atlassian Admin Cloud
    • ๐ŸŒŒIntroduction
    • โ„น๏ธOrganization
      • ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆDirectory
      • ๐Ÿ‘”Policy
    • ๐Ÿ‘ฅUser
      • ๐Ÿ”“Token
    • ๐ŸงฐSCIM
      • ๐Ÿง™โ€โ™‚๏ธUsers
      • โ›น๏ธโ€โ™‚๏ธGroups
      • ๐Ÿ”ฉSchemas
  • Bitbucket Cloud
    • ๐Ÿ‘จโ€๐Ÿ’ปIntroduction
    • ๐Ÿ“ฐWorkspace
      • ๐Ÿ›ก๏ธPermissions
      • ๐Ÿ’พWebhooks
Powered by GitBook
On this page
  • Attribute types
  • Create object type attribute
  • Update object type attribute
  • Delete object type attribute

Was this helpful?

Export as PDF
  1. Jira Assets
  2. Object
  3. Type

Attribute

PreviousTypeNextIntroduction

Last updated 1 year ago

Was this helpful?

Attributes are fields that let you add important information to your objectsโ€”it can really be anything that you need. You specify attributes for an object type, and then they're passed on to all child objects, requiring users to fill them in. An object type comes with a default set of attributes.

Attribute types

You can select the attribute type, this setting determines how the attribute value should be managed (and if its allowed).

Create object type attribute

POST /jsm/assets/workspace/{workspaceId}/v1/objecttypeattribute/{objectTypeId}

The Create method creates a new attribute on the given object type.

package main

import (
	"context"
	"github.com/ctreminiom/go-atlassian/assets"
	"github.com/ctreminiom/go-atlassian/jira/sm"
	"github.com/ctreminiom/go-atlassian/pkg/infra/models"
	"github.com/davecgh/go-spew/spew"
	"log"
	"os"
)

func main() {

	var (
		host  = os.Getenv("HOST")
		mail  = os.Getenv("MAIL")
		token = os.Getenv("TOKEN")
	)

	serviceManagement, err := sm.New(nil, host)
	if err != nil {
		log.Fatal(err)
	}

	serviceManagement.Auth.SetBasicAuth(mail, token)
	serviceManagement.Auth.SetUserAgent("curl/7.54.0")

	// Get the workspace ID
	workspaces, response, err := serviceManagement.WorkSpace.Gets(context.Background())
	if err != nil {
		if response != nil {
			log.Println(response.Bytes.String())
			log.Println("Endpoint:", response.Endpoint)
		}
		log.Fatal(err)
	}

	workSpaceID := workspaces.Values[0].WorkspaceId

	// Instance the Assets Cloud client
	asset, err := assets.New(nil)
	if err != nil {
		log.Fatal(err)
	}

	asset.Auth.SetBasicAuth(mail, token)

	payload := &models.ObjectTypeAttributeScheme{
		Name: "User Responsible",
		Type: 2,
	}

	objectTypeAttribute, response, err := asset.ObjectTypeAttribute.Create(context.Background(), workSpaceID, "2", payload)
	if err != nil {
		if response != nil {
			log.Println(response.Bytes.String())
			log.Println("Endpoint:", response.Endpoint)
		}
		log.Fatal(err)
	}

	spew.Dump(objectTypeAttribute)
	log.Println("Endpoint:", response.Endpoint)
}

Update object type attribute

PUT /jsm/assets/workspace/{workspaceId}/v1/objecttypeattribute/{objectTypeId}/{id}

The Update method updates an existing object type attribute

package main

import (
	"context"
	"github.com/ctreminiom/go-atlassian/assets"
	"github.com/ctreminiom/go-atlassian/jira/sm"
	"github.com/ctreminiom/go-atlassian/pkg/infra/models"
	"github.com/davecgh/go-spew/spew"
	"log"
	"os"
)

func main() {

	var (
		host  = os.Getenv("HOST")
		mail  = os.Getenv("MAIL")
		token = os.Getenv("TOKEN")
	)

	serviceManagement, err := sm.New(nil, host)
	if err != nil {
		log.Fatal(err)
	}

	serviceManagement.Auth.SetBasicAuth(mail, token)
	serviceManagement.Auth.SetUserAgent("curl/7.54.0")

	// Get the workspace ID
	workspaces, response, err := serviceManagement.WorkSpace.Gets(context.Background())
	if err != nil {
		if response != nil {
			log.Println(response.Bytes.String())
			log.Println("Endpoint:", response.Endpoint)
		}
		log.Fatal(err)
	}

	workSpaceID := workspaces.Values[0].WorkspaceId

	// Instance the Assets Cloud client
	asset, err := assets.New(nil)
	if err != nil {
		log.Fatal(err)
	}

	asset.Auth.SetBasicAuth(mail, token)

	payload := &models.ObjectTypeAttributeScheme{
		Name: "User Responsible - updated",
		Type: 2,
	}

	objectTypeAttribute, response, err := asset.ObjectTypeAttribute.Update(context.Background(), workSpaceID, "2", "29", payload)
	if err != nil {
		if response != nil {
			log.Println(response.Bytes.String())
			log.Println("Endpoint:", response.Endpoint)
		}
		log.Fatal(err)
	}

	spew.Dump(objectTypeAttribute)
	log.Println("Endpoint:", response.Endpoint)
}

Delete object type attribute

DELETE /jsm/assets/workspace/{workspaceId}/v1/objecttypeattribute/{id}

The Delete method deletes an existing object type attribute

package main

import (
	"context"
	"github.com/ctreminiom/go-atlassian/assets"
	"github.com/ctreminiom/go-atlassian/jira/sm"
	"log"
	"os"
)

func main() {

	var (
		host  = os.Getenv("HOST")
		mail  = os.Getenv("MAIL")
		token = os.Getenv("TOKEN")
	)

	serviceManagement, err := sm.New(nil, host)
	if err != nil {
		log.Fatal(err)
	}

	serviceManagement.Auth.SetBasicAuth(mail, token)
	serviceManagement.Auth.SetUserAgent("curl/7.54.0")

	// Get the workspace ID
	workspaces, response, err := serviceManagement.WorkSpace.Gets(context.Background())
	if err != nil {
		if response != nil {
			log.Println(response.Bytes.String())
			log.Println("Endpoint:", response.Endpoint)
		}
		log.Fatal(err)
	}

	workSpaceID := workspaces.Values[0].WorkspaceId

	// Instance the Assets Cloud client
	asset, err := assets.New(nil)
	if err != nil {
		log.Fatal(err)
	}

	asset.Auth.SetBasicAuth(mail, token)

	response, err = asset.ObjectTypeAttribute.Delete(context.Background(), workSpaceID, "29")
	if err != nil {
		if response != nil {
			log.Println(response.Bytes.String())
			log.Println("Endpoint:", response.Endpoint)
		}
		log.Fatal(err)
	}

	log.Println("Endpoint:", response.Endpoint)
}
Attribute type
Type value
Additional value
Description
Attribute type
Type value
Additional value
Description
Attribute type
Type value
Additional value
Description
Attribute type
Type value
Additional value
Description
Attribute type
Type value
Additional value
Description
Attribute type
Type value
Additional value
Description
Attribute type
Type value
Additional value
Description
Attribute type
Type value
Additional value
Description
Attribute type
Type value
Additional value
Description
Attribute type
Type value
Additional value
Description
Attribute type
Type value
Additional value
Description
Attribute type
Type value
Additional value
Description
Attribute type
Type value
Additional value
Description
Attribute type
Type value
Additional value
Description
Attribute type
Type value
Additional value
Description
Attribute type
Type value
Additional value
Description
Attribute type
Type value
Additional value
Description
Attribute type
Type value
Additional value
Description

Default

Text

-

Data type with text representation, often used to show normal text. Max 450 characters.

Boolean

-

Data type with only two possible values: true or false.

Integer

-

Commonly known as a "whole number", is a number that can be written without a fractional component. For example, 21, 4, and โˆ’2048 are integers.

This Attributes supports the Long Integer and will allow numbers that range from -2,147,483,648 to +2,147,483,647

Float

-

Data type representing numbers with decimals.

Date

-

Data type representing a Date field.

DateTime

-

Data type representing a Date and Time field.

URL

-

Data type representing an URL field. May be used for URL Ping service that pings the address every 5 minutes from the server side. Watch object to get email notifications on URL Ping Up/Down.

Email

-

Data type representing an email field.

Textarea

-

Data type with text representation, often used when showing large text. Use Assets rich editor to customize the content. Unlimited characters in comparison to the Text attribute.

For developers: Missing attribute beans

Hereโ€™s some info for developers trying to retrieve beans for this attribute using Java API.

Select

-

Data type to represent text values, predefined as options.

IP Address

-

Data type to represent IP Addresses (IPv4)

Object

Assets object

Reference Type

This type enables a reference to another object.

User

Jira group

Show on Profile

This type makes it possible to select a user from the selected Jira group and connect objects with users.

Confluence

Confluence instance

Confluence page

This type enables a link to a Confluence page.

Group

-

Show on Profile

This type makes it possible to select a Jira group and connect object(s) with user(s) in specified groups.

Version

Jira Project

-

This type makes it possible to reference a Jira Version from a specific Jira Project to your object(s).

Project

None

-

This type makes it possible to reference a Jira Project to your object(s).

Status

Allowed Statuses

-

This type is used to set a Status of an object. Define the statuses that should be allowed, and left empty means all statuses allowed.

๐Ÿ›๏ธ
๐Ÿงฐ
๐Ÿ›Ž๏ธ

Tell me more...
Page cover image