# AppSourceCop Hidden AS0076
Attribute tag format.
## Description
Attribute tag must have a specific format.
## Remarks
The tag values for the ../attributes/devenv-obsolete-attribute and ../attributes/devenv-requiredpending-attribute attributes, and the ../properties/devenv-obsoletetag-property, are not validated by the AL compiler. However, you can set up the AppSourceCop to verify them using a Regex expression. The same obsoleteTagPattern applies to both Obsolete and RequiredPending tags.
## Setting up AppSourceCop to validate the Obsolete Tag
### Enabling the rule using a ruleset
The diagnostics for rule AS0076 are hidden by default, so you first have to use a ../devenv-rule-set-syntax-for-code-analysis-tools to surface them.
For example, the following ruleset turns the diagnostic for rule AS0076 into an error.
```json
{
    "name": "My custom ruleset",
    "rules": [
        {
            "id": "AS0076",
            "action": "Error",
            "justification": "Validating that obsolete tags are formated properly is important"
        }
    ]
}
```
```json
{
    "al.ruleSetPath": "custom.ruleset.json"
}
```
> NOTE
> To fully validate obsolete properties and attributes, we recommend enabling the rules appsourcecop-as0072, appsourcecop-as0073, appsourcecop-as0074, appsourcecop-as0075, and appsourcecop-as0076.
### Setting up the AppSourceCop.json
By default, the rule will validate that the specified obsolete tags are following the pattern `(\\d+)\\.(\\d+)`.
However, it is possible to specify a custom pattern as a regular expression using the obsoleteTagPattern property in the AppSourceCop.json.
The property obsoleteTagPatternDescription can be used to provide a human readable version of the expected pattern.
The pattern description is used when reporting diagnostics.
```json
{
    "obsoleteTagPattern": "^[A-Z]{3}$",
    "obsoleteTagPatternDescription": "Three upper case letters"
}
```
## How to fix this diagnostic?
To fix this diagnostic, make sure that your obsolete tags are matching the expected obsoleteTagPattern.
For instance, when using the default obsolete tag pattern, two diagnostics will be reported by rule AS0076 because the obsolete tag property and the obsolete tag attribute parameter values do not respect the format Major.Minor.
```al
codeunit 50100 MyCodeunit
{
    ObsoleteState = Pending;
    ObsoleteReason = 'Use codeunit X instead.';
    ObsoleteTag = 'Next major';

    [Obsolete('Use function Y instead', 'Next spring')]
    procedure MyProcedure()
    begin
    end;
}
```
The code should be fixed a follows:
```al
codeunit 50100 MyCodeunit
{
    ObsoleteState = Pending;
    ObsoleteReason = 'Use codeunit X instead.';
    ObsoleteTag = '17.0';

    [Obsolete('Use function Y instead', '17.0')]
    procedure MyProcedure()
    begin
    end;
}
```
> NOTE
> The version to specify when using the default obsolete tag pattern is validated by the rules appsourcecop-as0072 and appsourcecop-as0074.
## Related information
AppSourceCop Analyzer<appsourcecop>
Get Started with AL<../devenv-get-started>
Developing Extensions<../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/analyzers/appsourcecop-as0076, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0076/
