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.
Hi,
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am interested to know how parent customfield values can be retrieved from Javascript , can this be done via REST api ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I will tell you in few mins, as I too have not tried this earlier.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you try the Scripted field as mentioned in my last answer?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.