Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can I add a field that will only be viewable and not editable

Eitan yomtovian
Contributor
March 25, 2018

field like 'end date'

1 answer

0 votes
Alexey Matveev
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 25, 2018

You can add the field only on the issue view screen. In this case the field will be only viewable. The other thing, which you have to keep in mind. The field will be visible on the view screen only if it has a value.

Eitan yomtovian
Contributor
March 29, 2018

Can you send me screenshots?

How do you get to the option of creating a new field that can only be viewed?

Alexey Matveev
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 29, 2018

You should create a different screen for the edit view screen and remove the required field from the screen and attach the screen to the screen scheme in the project. I attached a screenshot:

Selection_033.png

Kindly read the articles below:

https://confluence.atlassian.com/adminjiraserver/defining-a-screen-938847288.html

https://confluence.atlassian.com/adminjiracloud/associating-screen-and-issue-operation-mappings-with-an-issue-type-776636504.html

Eitan yomtovian
Contributor
April 1, 2018

 

I press on the buttom of 'Associate an issue operation with a screen' and choose the option 'Issue Operation'  I choose 'View issue' and press 'OK'.

After that I define which fields will be just viewable, but in the end of this process  nothing changes.

 

What am I not doing right?

Alexey Matveev
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.
April 1, 2018

There are three screens, which you can define for an issue: create, edit and view. If you have a filed only on the view screen and the field is not present on the edit screen, then you will not be able to edit the field.

What do you mean by nothing changes? You can still edit the field, can not you? If so, check that the filed is absent for the edit screen.

Eitan yomtovian
Contributor
April 2, 2018

"There are three screens, which you can define for an issue: create, edit and view. If you have a filed only on the view screen and the field is not present on the edit screen, then you will not be able to edit the field."

 

Okey, but in my case I want that the task manger in the creation on the issue will enter a due date and after that he could not be able to update only to view this field.

Nic Brough -Adaptavist-
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.
April 2, 2018

Put the field on the Create screen, but not edit.

Eitan yomtovian
Contributor
April 2, 2018

But this field should get initial value.

Nic Brough -Adaptavist-
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.
April 2, 2018

Yes, the user can fill it in on issue creation.  You can make it mandatory too.

Eitan yomtovian
Contributor
April 3, 2018

But if I add this filed ,that must to be for view only, on issue creation this filed became editable.

Nic Brough -Adaptavist-
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.
April 3, 2018

Could you please make up your mind?  Do you want the user to be able to enter the field on create issue or not?

Eitan yomtovian
Contributor
April 4, 2018

That's what I'm planning:

The user will enter the ORIGINAL ESTIMATE and then there will be a script which will convert this duration to the end date - the same date will be in a separate field which will be uneditable.

Nic Brough -Adaptavist-
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.
April 4, 2018

Right, so that is not what you originally asked about, but makes sense now you've given us the context, and finally explained that it's two fields, not one.

There are, in fact, two good ways to do this, both of which I would do with ScriptRunner (of course, as I work with them)

Method 1:

  • Put the timetracking field on the Create screen.  Do not put it on Edit or Transition screens.
  • Create a new date/time field (unless you want to use the existing system due-date field).  Place that field on the issue view screen only.
  • Write a scripted post-function on the "create issue" transition that reads the estimate from the user's entered data and populates the date/time field.
  • Consider adding "clear estimate" to the end of the script as you're not going to use it again.

Method 2:

 

  • Put the timetracking field on the Create screen.  Do not put it on Edit or Transition screens.
  • Create a new Scripted field with an output type of date/time that calculates the date from the estimate

I lean towards the second one, because it leaves me the flexibility to still use all the estimate and time tracking functionality while maintaining my end date without having to add loads of stuff in listeners or workflows.

Eitan yomtovian
Contributor
April 8, 2018

Okey, I have some questions about your answer:

1. How to write a scripted post-function on the "create issue" transition that reads the estimate from the user's entered data and populates the date/time field?

2.How to consider adding "clear estimate" to the end of the script as you're not going to use it again?

3. How to create a new Scripted field with an output type of date/time that calculates the date from the estimate?

I am new in writing scripting, so I will need extended explanation.

Thank you.

Eitan.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events