Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

changing the color of the created field

A L February 7, 2021

Good afternoon! tell me how you can change the color of one field, from the standard to red or greenСнимок экрана 2021-02-07 в 12.44.30.png

2 comments

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 7, 2021

Hi @A L  - I am not aware of anyway to change the color of a field in the display. 

Like Dave Rosenlund likes this
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 7, 2021

Hi, 

I did it one time with Scriptrunner (listener if i remember well). But it was a customfield and i was able to change only the color of the value field not the customfield name on the left side.

Like # people like this
A L February 7, 2021

we could tell you how you managed to do it thank you in advance!

Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 8, 2021

Hi,

 

I used a script fragment and wrote this code on the provider class/script field:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue

//def issueManager = ComponentAccessor.getIssueManager()
def issue = context.issue as Issue
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cField = customFieldManager.getCustomFieldObject("your customfield Id")
def cFieldValue = issue.getCustomFieldValue(cField)



def color = ""// use hex color or color name

writer.write("<script>var css = '#YOUR CUSTOMFIELD ID-val { color: white;background-color: ${color}; font-weight: bold; border-bottom: 2px solid ${color}; }', head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style');head.appendChild(style);style.appendChild(document.createTextNode(css));</script>")

 In the Location field select "atl.jira.view.issue.left.context"

It will display something like this

 

Capture d’écran 2021-02-08 à 11.47.21.png

 

 

Like Dave Rosenlund likes this

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events