The CreatorCon Call for Content is officially open! Get started here.

custom view should be set as default for creating new request

Athena Mathews
Tera Contributor

Hi Community!

 

This is about the view rule requirement. I have seen a similar post and that did solve part of my issue.

What I have done so far is:

I have created a custom view "Deployment_view" on change request and I need to make it a default view such that when anyone creates a new change request, they will only be able to create it in this deployment view. Thankful to another post, I could achieve it. This is the script :

 

(function overrideView(view, is_list) {
    if (is_list) {
        answer = "Deployment_view";
        return answer;
    }
	
    var url = gs.action.getGlideURI().getMap();
    var sys_id = url.get('sys_id');
    if (sys_id) {
        var grchg = new GlideRecord('change_request');
        if (grchg.get(sys_id)) {
            if (grchg.correlation_id == "") {
                answer = 'Deployment_view';
            } else
                answer = "Integration_view";
        }
    }
	
})(view, is_list);

So as per our requirement, when user goes to module change > click on all > new > he could create it in Deployment view only and based on the condition mentioned, post creation ticket will only be in either deployment_view or integration_view.

What needs to be done:

This is good so far but when user clicks on change module > create new , then this page opens up to select either normal/emergency/ standard and then when we click on say normal, the ticket is still in default view ., How do I set this "create new" module so that even from here, tickets can only be created in "Deployment_view"?

create new.jpg

 

Thanks,

Athena

 

1 ACCEPTED SOLUTION

Hi @Athena Mathews ,

This will work too!

Great find.

 

Best Regards
Aman Kumar

View solution in original post

5 REPLIES 5

Hi @Athena Mathews ,

This will work too!

Great find.

 

Best Regards
Aman Kumar