Custom Field value entered while creating issue should appear while creating sub-task as non editable text.

Suppose there is a Custom field Business Demand, the value entered in this field should appear as a non editable text while creating its sub-task. EX: Business Demand abcd. Both, field and its value should appear while creating sub-task.

5 answers


Look at the link, this way you can make it readonly,

Reg copying the value from parent to sub task you can try what Nic said or you can use Java script overall for copying and for making the field readonly.

Hope this helps.

If I am not wrong this will make the customfield readonly on all the screens . The field should be readonly only while creating the subtask i.e Subtask creation screen.

Mizan you are correct, the link is just an example to educate people, how to achieve, and it is not a straight forward answer for his question, and slight coding changes has to be done, for his question.

I am interested to know how parent customfield values can be retrieved from Javascript , can this be done via REST api ?

I will tell you in few mins, as I too have not tried this earlier.

0 votes

This does not quite make sense. If you are creating a new issue, then the field will have no value because you haven't entered one yet, so there's nothing to display in a read-only mode.

I suspect what you mean is that "Business Demand" is not actually a field that belongs to the sub-task, it applies only to the parent, and you want to display it on the create screen for the sub-task? If so, then you're going to need a plugin that provides that display. I used to use velocity fields in the Jira toolkit to do this, but they've been removed because of security concerned in recent versions of the plugin, so you may have to look at other options.

Secondly, you may want to inherit it from the parent - you'll need a "copy value from parent" post-function plugin to do that.

I am wondering, can't this be achieved used our famous Script Runner with a Scripted Field if the requirement is to show the value from the parent field in the sub-task while viewing.

Rohan, can you explain the usecase a bit, why do you want to show the parent field in the sub-task during creation? Isn't sufficient to show in the sub-task while viewing?

While creating, not possible with this approach, it has to be REST api if needed, as Mizan said. Embed the javascript to retrieve the value (using REST using jQuery) in the description of text field (also make the field readonly) and set the value of the field.

(hope that there is some field in the create subtask screen which contains the issue id of the parent)

I thank everyone for the help. I have partially succeded in this task as I am able to get the field and its value while creating sub-task, but the issue is it is appearing as an editable text. I just need to make it non-editable or read-only. I used Copy to sub-task plugin to achieve this. Please help me out.

Did you try the Scripted field as mentioned in my last answer?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,435 views 15 19
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you