Embedding javascript in standardfield?

Raju KC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 21, 2013

If we click on Field Configuration, we can edit the description of Standard fields.

Is it possible to embed Java Scripts in Standard fields as well?

2 answers

1 accepted

0 votes
Answer accepted
dleng
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 21, 2013

If you're talking about system fields such as Affects Versions and Description, then yes, you can too.

Raju KC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 21, 2013

OK, then how can we get value from resolution field and assign to custom field?

Any javascript help would be grateful!!!

Henning Tietgens
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 21, 2013

Maybe you should ask this as a new question?

Jos Braaksma March 21, 2013

Consider these points:

  • do you want users to be able to change the custom field value after it's been copied?
  • do you want to overwrite any value already in the custom field on changes to the resolution field?
  • is there any other way than screens that the source value may change?

In stead of JavaScript, you could use my plugin: Slingshot Updatefields to achieve this.

It contains a Workflow Post function and a Listener that you can configure to copy fields within an issue or between issues. It supports build-in fields and customfields of build-in types.

Jos

Raju KC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 21, 2013

For now, I prefer javascript.

Jos Braaksma March 21, 2013

then get some html dev plugin for your browser to see what's going on (to get the id's mainly) and try something along those lines for the field description:

<script language="JavaScript" type="text/javascript">
    <!--
    if(window.addEventListener) {
document.getElementById('sourceid').addEventListener('change', setValue, false);
    } else if (window.attachEvent){
document.getElementById('sourceid').attachEvent("onchange", setValue);
    }

    function setValue() {
        var target = document.getElementById('targetid');
        target.value = this.value;
    }
    // -->
</script>

cheers, Jos

Raju KC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 24, 2013

How to know ID for system field likes "resolution" ?

var target=document.getElementById('targetid');

1 vote
Henning Tietgens
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 21, 2013

Should be. We successfully embed html in a system field description.

Henning

Suggest an answer

Log in or Sign up to answer