Forums

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

Auto populate field in view screen when issue gets made from create screen

Joe
Contributor
November 11, 2020

I have two fields one in the create screen and one in the view screen. The first field is named computer and the options are monitor, printer and scanner. The second field is named approver and the options are bob, mike and joe. When I choose monitor in the create screen it should auto populate bob in the view screen under approver. I know this can be done with automation but is there another way to do this? With automation sometimes there is a lag to auto populate. Also, scriptrunner would not be a viable option since the code might need to be updated later on. Furthermore, cascading list would not be a option since the request is to not show the approver in the create screen only when the user selects a computer option then it should auto populate in the view screen who the corresponding approver is. I was thinking post functions would work.

If there is a solution to refreshing the page after the automation is complete I would be open to this. I read about the re fetch action but not sure if this refreshes the page for automation to show. 

I appreciate any input.  

1 answer

2 votes
Dirk Ronsmans
Community Champion
November 11, 2020

Hi @Joe ,

I get your frustration, the "your issue is updated, please refresh to see what happened" with automation is just annoying. An auto refresh option would be really great.

How we set this up (and by no means the best/only solution, just how we tackled it), is by using a combination of Insight and Scriptrunner.

By using a couple of Insight custom fields (as you are on DC that should work) which store the values you need (such as computer).

On the Insight Object schema we have defined a seperate metadata scheme that holds an object and it's approver (as an attribute).  You could also see this as a product and the product owner/approver perhaps in a more generic fashion?

What we then do is using a post function we check the entered value (computer) and fetch the approver from the Insight object. For us this works and we use it as a generic solution for a lot of things. 

When only using scriptrunner you would indeed need to hardcode it and that can be a hassle to adapt each time. With the addition of insight we made it more managable through the CMDB.

This is just one of the options and requires another investment so it depends if you already have a CMDB (perhaps Insight) set up or if plan on creating one in the future. Otherwise the investment might be a bit high just for this one use-case.

Joe
Contributor
November 12, 2020

Hi @Dirk Ronsmans 

I appreciate your input. Which post function would be used to check the entered value? 

Dirk Ronsmans
Community Champion
November 12, 2020

I would make an Insight Custom field on the Request form.

Based on that I would make a Scriptrunner Postfunction. That script can then get the value from the issue and you can do the comparison/get the attribute you need from that Insight Object

Joe
Contributor
November 13, 2020

Hi @Dirk Ronsmans Thanks I will give this a try

Suggest an answer

Log in or Sign up to answer