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).
Data type with text representation, often used to show normal text. Max 450 characters.
Data type with only two possible values: true or false.
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
Data type representing numbers with decimals.
Data type representing a Date field.
Data type representing a Date and Time field.
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.
Data type representing an email field.
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.
Tell me more...
Data type to represent text values, predefined as options.
Data type to represent IP Addresses (IPv4)
This type enables a reference to another object.
This type makes it possible to select a user from the selected Jira group and connect objects with users.
This type enables a link to a Confluence page.
This type makes it possible to select a Jira group and connect object(s) with user(s) in specified groups.
This type makes it possible to reference a Jira Version from a specific Jira Project to your object(s).
This type makes it possible to reference a Jira Project to your object(s).
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.
Create object type attribute
POST /jsm/assets/workspace/{workspaceId}/v1/objecttypeattribute/{objectTypeId}
The Create method creates a new attribute on the given object type.
Copy 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
Copy 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
Copy 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)
}